Resize an image

Monkey Forums/Monkey Programming/Resize an image

Citty(Posted 2014) [#1]
I can't resize an image, And I really need to.

[Import mojo

Class Game Extends App

Field image:Image

Method OnCreate()
SetUpdateRate 30
image=LoadImage("keyboard.png")
End

Method OnRender()
Cls
DrawImage image,0,0
End

End

Function Main()
New Game()
End]


Raph(Posted 2014) [#2]
If all you want to do is draw the same image at different sizes, try:

DrawImage : Int ( image:Image, x:Float, y:Float, rotation:Float, scaleX:Float, scaleY:Float, frame:Int=0 )


So to get an image at half size, you'd use

DrawImage(yourImage, 0, 0, 0, 0.5, 0.5 )


And at double size,

DrawImage(yourImage, 0, 0, 0, 2, 2 )



Citty(Posted 2014) [#3]
thanks