smaller image movements
smaller image movements
Hi I am wanting to make a 2d game but draw2dimage only allows the s32 value for position2d, is there any way to do smaller movements.
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
To be suuuuuper explicit, you could store and manipulate your sprite positions using f32 or even f64, then simply cast to s32 when specifying the screen position. Casting will always round down, so if you're really concerned about pixel accuracy and want to round to the nearest whole pixel, you could do (s32)(actor->X + 0.5f), (s32)(actor->Y + 0.5f).
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way