Skip to main content
GameDev.net gamedev.net
🔒 Locked

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

Started by Luhan M. Dec 16, 2017 at 3:54 PM 5 replies 2.1k views
Original Post
Luhan M.
Luhan M.

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.

Luhan M.
Luhan M.

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)

Scouting Ninja
Scouting Ninja
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.

Luhan M.
Luhan M.
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.

Satharis
Satharis

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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.