Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Some functions for rotating scaled sprites in 2d

Author
Message
bodmcn
14
Years of Service
User Offline
Joined: 6th Oct 2010
Location:
Posted: 13th Nov 2010 02:41
Being a newbie myself, I thought I would post these functions in case anyone found them useful. They are used to calculate and display the rotating of a sprite that has been scaled with the SCALE SPRITE() function.

There are also some functions for returning the X, Y positions of the rotated sprite from an offset and likewise the degrees of the rotation given and X and Y.

I hope someone might find them useful.



Notes:
spr parameter is the Sprite Number (I used eXtends for loading in sprites)
deg parameter is degrees with 0 at 12 o' clock
scale is a percentage value of the value used to scale the sprite

Login to post a reply

Server time is: 2024-11-23 07:34:03
Your offset time is: 2024-11-23 07:34:03