Sign in to follow this  

how to resize 2D sprite

Recommended Posts

Original post by Emil_Halim
a few days ago i learned how to rotate 2D , Now i want Resizing.
Your rotation function can do scaling too. Just multiply the cos/sin rotation vector by a scaling constant.
It's not as efficient as a decicated a sprite scaler but at least you won't have to write much code.

Share this post

Link to post
Share on other sites
it works very well but you need to change the next line

outerDeltaV = -innerDeltaU;


outerDeltaV = innerDeltaU;


innerDeltaU = cos(3.14*2) * ScaleFactor;
innerDeltaV = sin(3.14*2) * ScaleFactor;

question :

how can i make 2 scale factors, one (ScaleX) for width and outher (ScaleY) for height.

thanks for help

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this