Pixel.new: Difference between revisions

From GiderosMobile
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''Available since:''' Gideros 2016.06<br/>
'''Class:''' [[Pixel]]<br/>


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


'''<translate>Available since</translate>:''' Gideros 2016.06<br/>
=== Parameters ===
'''<translate>Class</translate>:''' [[Special:MyLanguage/Pixel|Pixel]]<br/>
'''color''': (number) hex value representing color '''optional'''<br/>
'''alpha''': (number) alpha value from 0 to 1 '''optional'''<br/>
'''width''': (number) width of pixel '''optional'''<br/>
'''height''': (number) height of pixel '''optional'''<br/>


=== <translate>Description</translate> ===
----
<translate>Create new pixel</translate>
<source lang="lua">
Pixel.new(color,alpha,width,height)
</source>


=== <translate>Parameters</translate> ===
__NOTOC__
'''color''': (number) <translate>hex value representing color</translate> '''optional'''<br/>
'''Available since:''' Gideros 2016.10<br/>
'''alpha''': (number) <translate>alpha value from 0 to 1</translate> '''optional'''<br/>
'''Class:''' [[Pixel]]<br/>
'''width''': (number) <translate>width of pixel</translate> '''optional'''<br/>
 
'''height''': (number) <translate>height of pixel</translate> '''optional'''<br/>
=== 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_ax,texture_ay)
</syntaxhighlight>
 
=== Parameters ===
'''texture''': (TextureBase or TextureRegion) texture to use for the Pixel<br/>
'''width''': (number) width of the Pixel '''optional'''<br/>
'''height''': (number) height of the Pixel '''optional'''<br/>
'''texture_scale_x''': (number) Pixel texture horizontal scale '''optional'''<br/>
'''texture_scale_y''': (number) Pixel texture vertical scale '''optional'''<br/>
'''texture_ax''': (number) Pixel texture horizontal anchor position (between 0 and 1) '''optional'''<br/>
'''texture_ay''': (number) Pixel texture vertical anchor position (between 0 and 1) '''optional'''<br/>
 
----


__NOTOC__
__NOTOC__
'''Available since:''' Gideros 2016.10<br/>
'''Class:''' [[Pixel]]<br/>


<languages />
=== Description ===
 
Constructor to create a Pixel with texture in '''Stretched''' mode. The texture will take all the Pixel size.
'''<translate>Available since</translate>:''' Gideros 2016.10<br/>
<syntaxhighlight lang="lua">
'''<translate>Class</translate>:''' [[Special:MyLanguage/Pixel|Pixel]]<br/>
Pixel.new(width,height,texture)
</syntaxhighlight>


=== <translate>Description</translate> ===
=== Parameters ===
<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>
'''width''': (number) width of the Pixel '''optional'''<br/>
<source lang="lua">
'''height''': (number) height of the Pixel '''optional'''<br/>
Pixel.new(texture,width,height,texture_scale_x,texture_scale_y,texture_x,texture_y)
'''texture''': (TextureBase or TextureRegion) texture to use for the Pixel<br/>
</source>


=== <translate>Parameters</translate> ===
{{Pixel}}
'''texture''': (TextureBase or TextureRegion) <translate>texture to use for the pixel</translate> <br/>
'''width''': (number) <translate>width of the Pixel</translate> '''optional'''<br/>
'''height''': (number) <translate>height of the Pixel</translate> '''optional'''<br/>
'''texture_scale_x''': (number) <translate>horizontal scale of the pixel texture</translate> '''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/>

Latest revision as of 00:34, 23 March 2025

Available since: Gideros 2016.06
Class: Pixel

Description

Creates a new Pixel sprite.

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 while preserving texture aspect ratio.

Pixel.new(texture,width,height,texture_scale_x,texture_scale_y,texture_ax,texture_ay)

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) Pixel texture horizontal scale optional
texture_scale_y: (number) Pixel texture vertical scale optional
texture_ax: (number) Pixel texture horizontal anchor position (between 0 and 1) optional
texture_ay: (number) Pixel texture vertical anchor position (between 0 and 1) optional



Available since: Gideros 2016.10
Class: Pixel

Description

Constructor to create a Pixel with texture in Stretched mode. The texture will take all the Pixel size.

Pixel.new(width,height,texture)

Parameters

width: (number) width of the Pixel optional
height: (number) height of the Pixel optional
texture: (TextureBase or TextureRegion) texture to use for the Pixel