Difference between revisions of "Pixel.new"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Creates a new pixel.
 
Creates a new pixel.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
Pixel.new(color,alpha,width,height)
 
Pixel.new(color,alpha,width,height)
 
</source>
 
</source>
Line 23: Line 23:
 
=== Description ===
 
=== Description ===
 
Constructor to create a Pixel with texture in letterbox mode. Every texture will be fitted into Pixel dimensions while preserving texture aspect ratio.
 
Constructor to create a Pixel with texture in letterbox mode. Every texture will be fitted into Pixel dimensions while preserving texture aspect ratio.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
Pixel.new(texture,width,height,texture_scale_x,texture_scale_y,texture_x,texture_y)
 
Pixel.new(texture,width,height,texture_scale_x,texture_scale_y,texture_x,texture_y)
 
</source>
 
</source>

Revision as of 14:30, 13 July 2023

Available since: Gideros 2016.06
Class: Pixel

Description

Creates a new pixel. <syntaxhighlight lang="lua"> Pixel.new(color,alpha,width,height) </source>

Parameters

color: (number) hex value representing color optional
alpha: (number) alpha value from 0 to 1 optional
width: (number) width of pixel optional
height: (number) height of pixel optional



Available since: Gideros 2016.10
Class: Pixel

Description

Constructor to create a Pixel with texture in letterbox mode. Every texture will be fitted into Pixel dimensions while preserving texture aspect ratio. <syntaxhighlight lang="lua"> Pixel.new(texture,width,height,texture_scale_x,texture_scale_y,texture_x,texture_y) </source>

Parameters

texture: (TextureBase or TextureRegion) texture to use for the pixel
width: (number) width of the Pixel optional
height: (number) height of the Pixel optional
texture_scale_x: (number) horizontal scale of the pixel texture optional
texture_scale_y: (number) vertical scale of the pixel texture optional
texture_x: (number) horizontal position of the pixel texture optional
texture_y: (number) vertical position of the pixel texture optional