Difference between revisions of "Sprite.tint"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>Sprite.tint:</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 colors...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<c>Sprite.tint:</c> Tint [[color]] to apply to the sprite image.  A tint of <c>color.red</c>,
+
<c>[[Sprite]].tint</c> is the tint [[color]] to apply to the [[Sprite|sprite]] image.  A tint of <c>color.red</c>,
 
for example, will make white pixels in the sprite image appear red; other
 
for example, will make white pixels in the sprite image appear red; other
 
colors will be mixed with (technically, multiplied by) red.
 
colors will be mixed with (technically, multiplied by) red.
 
 
=== Arguments ===
 
 
{| class="wikitable"
 
|-
 
! Parameter Name !! Type !! Default Value !! Meaning
 
|-
 
| ''paramnamd1'' || type || default value || description
 
|}
 
  
 
=== Usage Notes ===
 
=== Usage Notes ===

Latest revision as of 23:10, 12 April 2020

Sprite.tint is the tint color to apply to the sprite image. A tint of color.red, for example, will make white pixels in the sprite image appear red; other colors will be mixed with (technically, multiplied by) red.

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 color.clear will make the sprite invisible (though this is not as efficient as simply removing the sprite from the display sprites list).

Example

sp = new Sprite
sp.image = file.loadImage("/sys/pics/Wumpus.png")
display(4).sprites.push sp
sp.tint = "#00FF0088"  // semi-transparent green