Difference between revisions of "Pixel.new"

From GiderosMobile
Line 6: Line 6:
 
  Pixel.new(color,alpha,width,height)
 
  Pixel.new(color,alpha,width,height)
 
</source>
 
</source>
 +
=== Parameters ===
 
'''color''': (number) hex value representing color '''optional'''<br/>
 
'''color''': (number) hex value representing color '''optional'''<br/>
 
'''alpha''': (number) alpha value from 0 to 1 '''optional'''<br/>
 
'''alpha''': (number) alpha value from 0 to 1 '''optional'''<br/>
Line 17: Line 18:
 
  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>
'''texture''': (Texture) texture to use for the pixel ''''''<br/>
+
=== Parameters ===
 +
'''texture''': (Texture) texture to use for the pixel <br/>
 
'''width''': (number) width of the Pixel '''optional'''<br/>
 
'''width''': (number) width of the Pixel '''optional'''<br/>
 
'''height''': (number) height of the Pixel '''optional'''<br/>
 
'''height''': (number) height of the Pixel '''optional'''<br/>

Revision as of 11:45, 23 August 2018

Available since: Gideros 2016.06

Description

Create new pixel

 Pixel.new(color,alpha,width,height)

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: in development

Description

Constructor to create a Pixel with texture in letterbox mode. Every texture will be fitted into Pixel dimensions with preserving texture aspect ratio.

 Pixel.new(texture,width,height,texture_scale_x,texture_scale_y,texture_x,texture_y)

Parameters

texture: (Texture) 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