Difference between revisions of "Sprite.scale"

From MiniScript Wiki
Jump to navigation Jump to search
(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...")
 
 
Line 1: Line 1:
<c>Sprite.scale</c> is the scale factor of the sprite.  A scale of 1 means that one pixel in
+
<c>[[Sprite]].scale</c> is the scale factor of the sprite.  A scale of 1 means that one pixel in
 
the [[Sprite.image|image]] appears as one pixel on screen.  Setting
 
the [[Sprite.image|image]] appears as one pixel on screen.  Setting
 
scale=2 makes the sprite appear twice as big; scale=0.5 makes it appear
 
scale=2 makes the sprite appear twice as big; scale=0.5 makes it appear

Latest revision as of 23:12, 12 April 2020

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