Scaling Images

Monkey Forums/Monkey Beginners/Scaling Images

Dale(Posted 2014) [#1]
This may be a noobish question, but this is the beginner forum...

I decided I wanted to learn Monkey, so I started today. I'm used to Blitz3D, with the simple ScaleImage command, but I can't seem to find a command like this in Monkey.

How do I scale an image?


Nobuyuki(Posted 2014) [#2]
two ways.

1. Scale(x,y) -- this scales the global matrix.
2. DrawImage(img,x,y,rotation,scaleX,scaleY) - this is an overload of DrawImage that lets you specify a rotation and scale.


Dale(Posted 2014) [#3]
Thank you so much! And the fact that rotation is in there is even better!


Gerry Quinn(Posted 2014) [#4]
If you're using this, make sure to set the handle to Image.MidHandle. Scaling and rotation is a nightmare with the default top left handle.


chimaera(Posted 2014) [#5]
I perfer to you Nobo's second suggestion as I personally think that it gives you the most control. The overload will only affect a specific image, while Scale uses the global matrix that will affect everything that is rendered if you do not reset it.