Weirdness with SPHOME
Root / Programming Questions / [.]
benjymousCreated:
Can anyone else test/confirm this for me that I'm not doing anything stupid?
If you use SPHOME to set the offset on a sprite, then use SPCHR to change the sprite image, it resets the offset (which doesn't appear to be documented)
This means if you use SPHOME to, say, set a character sprite offset at their feet, the animate using SPCHR, you need to remember to set SPHOME again each frame.
For the record, SB already comes with sprite definitions with SPHOME at the feet. Just add 2048 to the definition number.Ahh, thanks - I totally managed to miss that On a semi-related issue, is there any way to change the sprite draw order so that they draw ordered by Y position, rather than management order?
Does it match your purpose to gear Z position to Y position?For the record, SB already comes with sprite definitions with SPHOME at the feet. Just add 2048 to the definition number.Ahh, thanks - I totally managed to miss that On a semi-related issue, is there any way to change the sprite draw order so that they draw ordered by Y position, rather than management order?
Yes, that mostly works - especially if I set the screen to 2D.
WIth 3D on, I notice a weirdness in that not all sprites at the same Y value seem to have the same depth (i.e. some sprites seem to stick out further than others). That might be a result of me using floating point values, I guess - so a sprite at Y:100.1 and Y:100.9 would have the same vertical screen position, but may end up with Z values that put them on different depth layers when it hits the 3D hardware.
I guess that it depends on frequency of sprite collision (density of sprite crowd).
Normally, the probability that sprite collision will occur must be low.
(In my program, all sprites share a X position.)
By the way, I've built EX_SPPRIO2, a little bit improved from EX_SPPRIO.
Could you download N3234PCP?