Sprite.scale
Revision as of 21:49, 12 April 2020 by ZachStrout (talk | contribs) (Created page with "<c>Sprite.scale</c> is the scale factor of the sprite. A scale of 1 means that one pixel in the image appears as one pixel on screen. Setting scale=2 makes...")
Sprite.scale
is the scale factor of the sprite. A scale of 1 means that one pixel in
the image appears as one pixel on screen. Setting
scale=2 makes the sprite appear twice as big; scale=0.5 makes it appear
half its standard size.
Usage Notes
You may also scale a sprite differently in x and y by assigning a list of two numbers; the first is the x scale, and the second is the y scale, as in the example below.
Example
sp = new Sprite
sp.image = file.loadImage("/sys/pics/Wumpus.png")
display(4).sprites.push sp
sp.scale = [2,1] // double the width, but leave height alone