Difference between revisions of "Pixel.new"
| Line 1: | Line 1: | ||
| __NOTOC__ | __NOTOC__ | ||
| − | + | '''Available since:''' Gideros 2016.06<br/> | |
| − | ''' | + | '''Class:''' [[Pixel]]<br/> | 
| − | ''' | ||
| − | ===  | + | === Description === | 
| − | + | Creates a new pixel. | |
| <source lang="lua"> | <source lang="lua"> | ||
| Pixel.new(color,alpha,width,height) | Pixel.new(color,alpha,width,height) | ||
| </source> | </source> | ||
| − | ===  | + | === Parameters === | 
| − | '''color''': (number)  | + | '''color''': (number) hex value representing color '''optional'''<br/> | 
| − | '''alpha''': (number)  | + | '''alpha''': (number) alpha value from 0 to 1 '''optional'''<br/> | 
| − | '''width''': (number)  | + | '''width''': (number) width of pixel '''optional'''<br/> | 
| − | '''height''': (number)  | + | '''height''': (number) height of pixel '''optional'''<br/> | 
| ---- | ---- | ||
| + | |||
| __NOTOC__ | __NOTOC__ | ||
| − | + | '''Available since:''' Gideros 2016.10<br/> | |
| − | ''' | + | '''Class:''' [[Special:MyLanguage/Pixel|Pixel]]<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. | |
| <source lang="lua"> | <source 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> | ||
| − | ===  | + | === Parameters === | 
| − | '''texture''': (TextureBase or TextureRegion)  | + | '''texture''': (TextureBase or TextureRegion) texture to use for the pixel<br/> | 
| − | '''width''': (number)  | + | '''width''': (number) width of the Pixel '''optional'''<br/> | 
| − | '''height''': (number)  | + | '''height''': (number) height of the Pixel '''optional'''<br/> | 
| − | '''texture_scale_x''': (number)  | + | '''texture_scale_x''': (number) horizontal scale of the pixel texture '''optional'''<br/> | 
| − | '''texture_scale_y''': (number)  | + | '''texture_scale_y''': (number) vertical scale of the pixel texture '''optional'''<br/> | 
| − | '''texture_x''': (number)  | + | '''texture_x''': (number) horizontal position of the pixel texture '''optional'''<br/> | 
| − | '''texture_y''': (number)  | + | '''texture_y''': (number) vertical position of the pixel texture '''optional'''<br/> | 
| {{Pixel}} | {{Pixel}} | ||
Revision as of 01:09, 5 December 2020
Available since: Gideros 2016.06
Class: Pixel
Description
Creates a 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 while 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
