Difference between revisions of "Texture.new"
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === <br /> Creates a new Texture object.<br /> <br /> <source lang="lua"> = Texture.new(filenamefilteringo...") |
|||
Line 6: | Line 6: | ||
<br /> | <br /> | ||
<source lang="lua"> | <source lang="lua"> | ||
− | + | Texture.new(filename,filtering,options) | |
</source> | </source> | ||
− | '''filename | + | '''filename''': (string) The name of the texture file to be loaded. ''''''<br/> |
− | '''filtering | + | '''filtering''': (boolean, default = false) Whether or not the texture is filtered. ''''''<br/> |
− | '''options | + | '''options''': (table, optional) A table that specifies optional paramaters. Currently, "transparentColor", "wrap", "format" and "extend" fields are supported. '''optional'''<br/> |
__NOTOC__ | __NOTOC__ | ||
'''Available since:''' Gideros 2016.08<br/> | '''Available since:''' Gideros 2016.08<br/> | ||
Line 16: | Line 16: | ||
Create a texture from pixel data. | Create a texture from pixel data. | ||
<source lang="lua"> | <source lang="lua"> | ||
− | + | Texture.new(pixels,width,height,filtering,options) | |
</source> | </source> | ||
− | '''pixels | + | '''pixels''': (string) A string containing actual R,G,B,A compoents of each pixel in the new texture. Each component is stored as a byte. You can pass nil if you don't need to initialize texture content ''''''<br/> |
− | '''width | + | '''width''': (number) width of the texture to create ''''''<br/> |
− | '''height | + | '''height''': (number) Height of the texture to create ''''''<br/> |
− | '''filtering | + | '''filtering''': (boolean, default to false) indicate that the texture should be filtered '''optional'''<br/> |
− | '''options | + | '''options''': (table, optional) A table that specifies optional paramaters. Currently, "transparentColor", "wrap", "format" and "extend" fields are supported. '''optional'''<br/> |
Revision as of 10:16, 23 August 2018
Available since: Gideros 2011.6
Description
Creates a new Texture object.
Texture.new(filename,filtering,options)
'filename: (string) The name of the texture file to be loaded. '
'filtering: (boolean, default = false) Whether or not the texture is filtered. '
options: (table, optional) A table that specifies optional paramaters. Currently, "transparentColor", "wrap", "format" and "extend" fields are supported. optional
Available since: Gideros 2016.08
Description
Create a texture from pixel data.
Texture.new(pixels,width,height,filtering,options)
'pixels: (string) A string containing actual R,G,B,A compoents of each pixel in the new texture. Each component is stored as a byte. You can pass nil if you don't need to initialize texture content '
'width: (number) width of the texture to create '
'height: (number) Height of the texture to create '
filtering: (boolean, default to false) indicate that the texture should be filtered optional
options: (table, optional) A table that specifies optional paramaters. Currently, "transparentColor", "wrap", "format" and "extend" fields are supported. optional