Difference between revisions of "Pixel.new"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2016.06<br/> === Description === Create new pixel <source lang="lua"> = Pixel.new(coloralphawidthheight,) </source> '''color:''' (numb...")
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Available since:''' Gideros 2016.06<br/>
+
<languages />
=== Description ===
+
'''<translate>Available since</translate>:''' Gideros 2016.06<br/>
Create new pixel
+
'''<translate>Class</translate>:''' [[Special:MyLanguage/Pixel|Pixel]]<br/>
 +
 
 +
=== <translate>Description</translate> ===
 +
<translate>Create new pixel</translate>
 
<source lang="lua">
 
<source lang="lua">
= Pixel.new(coloralphawidthheight,)
+
Pixel.new(color,alpha,width,height)
 
</source>
 
</source>
'''color:''' (number) hex value representing color '''optional'''<br/>
+
 
'''alpha:''' (number) alpha value from 0 to 1 '''optional'''<br/>
+
=== <translate>Parameters</translate> ===
'''width:''' (number) width of pixel '''optional'''<br/>
+
'''color''': (number) <translate>hex value representing color</translate> '''optional'''<br/>
'''height:''' (number) height of pixel '''optional'''<br/>
+
'''alpha''': (number) <translate>alpha value from 0 to 1</translate> '''optional'''<br/>
 +
'''width''': (number) <translate>width of pixel</translate> '''optional'''<br/>
 +
'''height''': (number) <translate>height of pixel</translate> '''optional'''<br/>
 +
 
 +
----
 
__NOTOC__
 
__NOTOC__
'''Available since:''' in development<br/>
+
<languages />
=== Description ===
+
'''<translate>Available since</translate>:''' Gideros 2016.10<br/>
Constructor to create a Pixel with texture in letterbox mode. Every texture will be fitted into Pixel dimensions with preserving texture aspect ratio.
+
'''<translate>Class</translate>:''' [[Special:MyLanguage/Pixel|Pixel]]<br/>
 +
 
 +
=== <translate>Description</translate> ===
 +
<translate>Constructor to create a Pixel with texture in letterbox mode. Every texture will be fitted into Pixel dimensions with preserving texture aspect ratio.</translate>
 
<source lang="lua">
 
<source lang="lua">
= Pixel.new(texturewidthheighttexture_scale_xtexture_scale_ytexture_xtexture_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/>
+
 
'''width:''' (number) width of the Pixel '''optional'''<br/>
+
=== <translate>Parameters</translate> ===
'''height:''' (number) height of the Pixel '''optional'''<br/>
+
'''texture''': (TextureBase or TextureRegion) <translate>texture to use for the pixel</translate><br/>
'''texture_scale_x:''' (number) horizontal scale of the pixel texture '''optional'''<br/>
+
'''width''': (number) <translate>width of the Pixel</translate> '''optional'''<br/>
'''texture_scale_y:''' (number) vertical scale of the pixel texture '''optional'''<br/>
+
'''height''': (number) <translate>height of the Pixel</translate> '''optional'''<br/>
'''texture_x:''' (number) horizontal position of the pixel texture '''optional'''<br/>
+
'''texture_scale_x''': (number) <translate>horizontal scale of the pixel texture</translate> '''optional'''<br/>
'''texture_y:''' (number) vertical position of the pixel texture '''optional'''<br/>
+
'''texture_scale_y''': (number) <translate>vertical scale of the pixel texture</translate> '''optional'''<br/>
 +
'''texture_x''': (number) <translate>horizontal position of the pixel texture</translate> '''optional'''<br/>
 +
'''texture_y''': (number) <translate>vertical position of the pixel texture</translate> '''optional'''<br/>
 +
 
 +
{{Pixel}}

Revision as of 03:11, 15 February 2020


Available since: Gideros 2016.06
Class: Pixel

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: Gideros 2016.10
Class: Pixel

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: (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