December 21, 2024, 05:37:02 PM

Username
Password

Pages: [1]   Go Down
Print
Author Topic: What is x and y in a frame from an .SPR sprite file?  (Read 1817 times)
0 Members and 1 Guest are viewing this topic.
jon
Giant Spider
*
Offline Offline

Posts: 11


View Profile
« on: March 14, 2024, 01:49:20 AM »

In http://wiki.dark-omen.org/do/Updated_Sprite_Format, we have:

signed short X;        // = X position of this frame
signed short Y;        // = Y position of this frame

But I don't really get what they are meant to be used for. For example, here's a random set of x,y,width,height from one sprite's frame:

x: -23, y: -31, width: 49, height: 31

Even in this example, if the sprite is 31 pixels tall, what could a y position of -31 be referring to?

Any ideas?
Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2300



View Profile
« Reply #1 on: March 15, 2024, 12:06:02 AM »

Good question and will investigate on the weekend and maybe refers to distance to the centre point like with Rob's rdose. When using it I position each frame over the red dot, so the animation is aligned properly.

http://en.dark-omen.org/downloads/view-details/1.-modding-tools/3.-sprite-editors/rdose.html
Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
jon
Giant Spider
*
Offline Offline

Posts: 11


View Profile
« Reply #2 on: March 17, 2024, 04:03:34 AM »

After some quick experimenting, I was able to find out some info, but I don't have a definitive answer for whether we can say x and y are for purpose P for every sprite (I could still be wrong).

I wrote my findings up here so it was easier to attach images: https://gist.github.com/jonathaningram/79fe2fdf331f6b98c2e4542c83e625e0

Logged
olly
Global Spokesperson
*
Offline Offline

Posts: 2300



View Profile
« Reply #3 on: March 17, 2024, 11:55:21 PM »

Well done, good research.
Logged

and back in Nuln, the ageing Graf Berhardt smiled his secret smile of pride whenever he heard the latest tales of his eldest son's ever growing chain of glorious victories -(sothr manual)
Pages: [1]   Go Up
Print
Jump to: