Difference between revisions of "Texture"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | |||
<languages /> | <languages /> | ||
− | |||
<!-- GIDEROSOBJ:Texture --> | <!-- GIDEROSOBJ:Texture --> | ||
− | + | '''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> | |
− | '''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]] | + | '''<translate>Available since</translate>:''' Gideros 2011.6<br/> |
− | <br/> | + | '''<translate>Inherits from</translate>:''' [[Special:MyLanguage/TextureBase|TextureBase]]<br/> |
− | |||
− | '''<translate>Available since</translate>:''' Gideros 2011.6 | ||
− | <br/> | ||
− | |||
− | '''<translate>Inherits from</translate>:''' [[Special:MyLanguage/TextureBase|TextureBase]] | ||
− | <br/> | ||
=== <translate>Description</translate> === | === <translate>Description</translate> === | ||
− | |||
The [[Special:MyLanguage/Texture|Texture]] class lets you work with textures in an application. The [[Special:MyLanguage/Texture|Texture]] class lets you create a new [[Special:MyLanguage/Texture|Texture]] object to load from an image file and display in scene tree. | The [[Special:MyLanguage/Texture|Texture]] class lets you work with textures in an application. The [[Special:MyLanguage/Texture|Texture]] class lets you create a new [[Special:MyLanguage/Texture|Texture]] object to load from an image file and display in scene tree. | ||
− | |||
− | |||
=== <translate>Example</translate> === | === <translate>Example</translate> === | ||
Line 37: | Line 26: | ||
stage:addChild(wall) | stage:addChild(wall) | ||
</source> | </source> | ||
− | |||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Methods</translate> === | === <translate>Methods</translate> === | ||
− | [[Special:MyLanguage/Texture.new|Texture.new]] ''<translate>creates a new Texture object</translate>'' | + | [[Special:MyLanguage/Texture.new|Texture.new]] ''<translate>creates a new Texture object</translate>''<br/><!-- GIDEROSMTD:Texture.new(filename,filtering,options) creates a new Texture object --> |
− | <br/> | + | [[Special:MyLanguage/Texture.new|Texture.new]]<br/><!-- GIDEROSMTD:Texture.new(pixels,width,height,filtering,options) --> |
− | <!-- GIDEROSMTD:Texture.new(filename,filtering,options) creates a new Texture object --> | ||
− | [[Special:MyLanguage/Texture.new|Texture.new]] | ||
− | <br/> | ||
− | <!-- GIDEROSMTD:Texture.new(pixels,width,height,filtering,options) --> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
Line 53: | Line 37: | ||
=== <translate>Constants</translate> === | === <translate>Constants</translate> === | ||
|} | |} | ||
− | |||
− |
Revision as of 00:18, 10 December 2019
Supported platforms:
Available since: Gideros 2011.6
Inherits from: TextureBase
Description
The Texture class lets you work with textures in an application. The Texture class lets you create a new Texture object to load from an image file and display in scene tree.
Example
-- TEXTURE REPEAT
wall = Shape.new()
local texture = Texture.new("gfx/enemy01.png", true, {wrap = Texture.REPEAT}) -- put your image.png
wall:setFillStyle(Shape.TEXTURE, texture)
wall:beginPath()
wall:moveTo(0,0)
wall:lineTo(150, 0)
wall:lineTo(150, 150)
wall:lineTo(0, 150)
wall:closePath()
wall:endPath()
wall:setAnchorPoint(0.5, 0.5)
wall:setPosition(128, 128)
stage:addChild(wall)
MethodsTexture.new creates a new Texture object |
EventsConstants |