Difference between revisions of "Pixel"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
 
<languages />
 
<languages />
 
 
<!-- GIDEROSOBJ:Pixel -->
 
<!-- GIDEROSOBJ:Pixel -->
 
+
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/>
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]
+
'''<translate>Available since</translate>:''' Gideros 2016.06<br/>
<br/>
+
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
 
 
'''<translate>Available since</translate>:''' Gideros 2016.06
 
<br/>
 
 
 
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]
 
<br/>
 
  
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
<translate>
 
 
A rectangular Sprite which can be filled with solid colors, gradients or textures.
 
A rectangular Sprite which can be filled with solid colors, gradients or textures.
 
Pixel aims at being a simpler and faster alternative to Shape when needing to display a coloured box or box with a gradient. It is also useful as Bitmap replacement since every texture will be fitted into Pixel dimensions automatically.
 
Pixel aims at being a simpler and faster alternative to Shape when needing to display a coloured box or box with a gradient. It is also useful as Bitmap replacement since every texture will be fitted into Pixel dimensions automatically.
</translate>
 
  
 
=== <translate>Example</translate> ===
 
=== <translate>Example</translate> ===
Line 28: Line 18:
 
stage:addChild(mypixel)
 
stage:addChild(mypixel)
 
</source>
 
</source>
<br/>
 
  
 
{|-
 
{|-
Line 55: Line 44:
 
=== <translate>Constants</translate> ===
 
=== <translate>Constants</translate> ===
 
|}
 
|}
 
{{Pixel}}
 

Revision as of 00:51, 10 December 2019


Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
Available since: Gideros 2016.06
Inherits from: Sprite

Description

A rectangular Sprite which can be filled with solid colors, gradients or textures. Pixel aims at being a simpler and faster alternative to Shape when needing to display a coloured box or box with a gradient. It is also useful as Bitmap replacement since every texture will be fitted into Pixel dimensions automatically.

Example

local mypixel = Pixel.new(0x0000FF, 0.75, 128, 128)
mypixel:setAnchorPoint(0.5, 0.5)
mypixel:setPosition(application:getContentWidth() / 2, 64)

stage:addChild(mypixel)

Methods

Pixel.new Create new pixel
Pixel.new Constructor to create a Pixel with texture in letterbox mode.
Pixel:getColor Gets the color(s) of the Pixel
Pixel:getDimensions
Pixel:getTexturePosition
Pixel:getTextureScale
Pixel:setColor Sets the color of the Pixel
Pixel:setColor
Pixel:setColor Sets 4-colour gradient.
Pixel:setDimensions Sets both width and height of the Pixel.
Pixel:setHeight Sets the height of the pixel sprite.
Pixel:setNinePatch Configure 9-patch style texture rendering.
Pixel:setTexture
Pixel:setTextureMatrix
Pixel:setTexturePosition
Pixel:setTextureScale
Pixel:setWidth Sets the width of the pixel sprite.

Events

Constants