smaller image movements

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
wizecoder
Posts: 13
Joined: Thu Jan 03, 2008 9:36 pm

smaller image movements

Post by wizecoder »

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. :?
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

Use an IGUIImage to do that, its cooler.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

draw2dimage only allows the s32 value for position2d
You are limited by screen resolution, there is no way you can get smaller step than one pixel.

But you may store position in smaller units if you want than calculate screen position out of it each frame.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

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
wizecoder
Posts: 13
Joined: Thu Jan 03, 2008 9:36 pm

Post by wizecoder »

Thanks it worked and now i have a Pong game made only with irrlicht. REALLY appreciate the help :D :D :D .
Post Reply