Difference between revisions of "Pixel"

From GiderosMobile
(added example to the main pixel page)
Line 44: Line 44:
 
[[Special:MyLanguage/Pixel:setDimensions|Pixel:setDimensions]] ''<translate>Sets both width and height of the Pixel.</translate>''<br/><!-- GIDEROSMTD:Pixel:setDimensions(w,h) Sets both width and height of the Pixel. -->
 
[[Special:MyLanguage/Pixel:setDimensions|Pixel:setDimensions]] ''<translate>Sets both width and height of the Pixel.</translate>''<br/><!-- GIDEROSMTD:Pixel:setDimensions(w,h) Sets both width and height of the Pixel. -->
 
[[Special:MyLanguage/Pixel:setHeight|Pixel:setHeight]] ''<translate>Sets the height of the pixel sprite.</translate>''<br/><!-- GIDEROSMTD:Pixel:setHeight(h) Sets the height of the pixel sprite. -->
 
[[Special:MyLanguage/Pixel:setHeight|Pixel:setHeight]] ''<translate>Sets the height of the pixel sprite.</translate>''<br/><!-- GIDEROSMTD:Pixel:setHeight(h) Sets the height of the pixel sprite. -->
 +
[[Special:MyLanguage/Pixel:setNinePatch|Pixel:setNinePatch]] ''<translate>Configure 9-patch style texture rendering.</translate>''<br/><!-- GIDEROSMTD:Pixel:setNinePatch(vl,vr,vt,vb,tl,tr,tt,tb)  -->
 
[[Special:MyLanguage/Pixel:setTexture|Pixel:setTexture]] <br/><!-- GIDEROSMTD:Pixel:setTexture(texture,slot,matrix)  -->
 
[[Special:MyLanguage/Pixel:setTexture|Pixel:setTexture]] <br/><!-- GIDEROSMTD:Pixel:setTexture(texture,slot,matrix)  -->
 
[[Special:MyLanguage/Pixel:setTextureMatrix|Pixel:setTextureMatrix]] <br/><!-- GIDEROSMTD:Pixel:setTextureMatrix(matrix)  -->
 
[[Special:MyLanguage/Pixel:setTextureMatrix|Pixel:setTextureMatrix]] <br/><!-- GIDEROSMTD:Pixel:setTextureMatrix(matrix)  -->

Revision as of 08:00, 27 August 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