Difference between revisions of "Sprite.rotation"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>Sprite.rotation</c>: Tint color to apply to the sprite image. A tint of <c>color.red</c>, for example, will make white pixels in the sprite image appear red; other col...")
 
m
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<c>Sprite.rotation</c>: Tint [[color]] to apply to the sprite image.  A tint of <c>color.red</c>,
+
<c>[[Sprite]].rotation</c> is the rotation of the sprite, in degrees counter-clockwise.
for example, will make white pixels in the sprite image appear red; other
+
 
colors will be mixed with (technically, multiplied by) red.
+
See also: [[Bounds.rotation]], [[/sys/demo/angles]]
  
=== Usage Notes ===
 
Assigning a tint color with an alpha less than 255 (FF) will make the
 
sprite semi-transparent.  In the extreme, setting a tint of <c>color.clear</c>
 
will make the sprite invisible (though this is not as efficient as simply
 
removing the sprite from the display [[SpriteDisplay.sprites|sprites]] list)
 
 
== Example ==
 
== Example ==
  
Line 13: Line 8:
 
sp.image = file.loadImage("/sys/pics/Wumpus.png")
 
sp.image = file.loadImage("/sys/pics/Wumpus.png")
 
display(4).sprites.push sp
 
display(4).sprites.push sp
sp.tint = "#00FF0088"  // semi-transparent green</ms>
+
sp.rotation = 45</ms>
  
 
[[Category:Mini Micro]]
 
[[Category:Mini Micro]]

Latest revision as of 21:35, 8 July 2021

Sprite.rotation is the rotation of the sprite, in degrees counter-clockwise.

See also: Bounds.rotation, /sys/demo/angles

Example

sp = new Sprite
sp.image = file.loadImage("/sys/pics/Wumpus.png")
display(4).sprites.push sp
sp.rotation = 45