Jump to content
  • Advertisement
Luhan M.

How to get the exact coordinate in an Atlas (SFML)

Recommended Posts

I downloaded a pack of sprites, and I was wondering how do you manage to get the exact coordinates of a smaller sprite in an Atlas.

Share this post


Link to post
Share on other sites
Advertisement

I forgot to mention that the pack doesn't come with the coordinates of each sprite, so there's a way to discover it? (seems like your answer depend on it)

Edited by Luhan M.

Share this post


Link to post
Share on other sites
2 hours ago, Luhan M. said:

I forgot to mention that the pack doesn't come with the coordinates of each sprite, so there's a way to discover it? (seems like your answer depend on it)

What? I don't get this question, each point is a pixel.

You can open the image in paint or any other image editor. Move the cursor to the start of the sprite, it should tell you the coordinate.

 

Using your eyes is the only way I can think of doing this that is fool proof. Even advance sprite editors depend on maps or the alpha channel. There is no automatic way of detecting sprites that works every time.

Share this post


Link to post
Share on other sites
1 hour ago, Scouting Ninja said:

What? I don't get this question, each point is a pixel.

You can open the image in paint or any other image editor. Move the cursor to the start of the sprite, it should tell you the coordinate.

 

Using your eyes is the only way I can think of doing this that is fool proof. Even advance sprite editors depend on maps or the alpha channel. There is no automatic way of detecting sprites that works every time.

Yeah, I did opened it in paint and used the coordinates, but I saw some people saying that an atlas should have come with the coordinates of each sprite. I thought there was some kind of way to retrieve each sprite more easy, instead of looking for the coordinates in the image editor.

Edited by Luhan M.

Share this post


Link to post
Share on other sites

Unless you're a wizard, using images from a texture atlas would either require uniformly sized images or a file describing the locations of each sub-image.

So yes, normally it should come with something. If no such file exists then you have little option besides figuring out the coordinates manually.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!