• Advertisement

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

Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Advertisement