Difference between revisions of "Bitmap.new"
From GiderosMobile
m (formatting) |
|||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
+ | |||
<languages /> | <languages /> | ||
− | '''<translate>Available since</translate>:''' Gideros 2011.6<br/> | + | |
− | '''<translate>Class</translate>:''' [[Special:MyLanguage/Bitmap|Bitmap]]<br/> | + | '''<translate>Available since</translate>:''' Gideros 2011.6 |
+ | <br/> | ||
+ | |||
+ | '''<translate>Class</translate>:''' [[Special:MyLanguage/Bitmap|Bitmap]] | ||
+ | <br/> | ||
+ | |||
=== <translate>Description</translate> === | === <translate>Description</translate> === | ||
− | <translate | + | <translate> |
− | Creates a new [[Special:MyLanguage/Bitmap|Bitmap]] object. | + | Creates a new [[Special:MyLanguage/Bitmap|Bitmap]] object. |
− | < | + | </translate> |
− | + | ||
<source lang="lua"> | <source lang="lua"> | ||
− | + | Bitmap.new(texture) | |
</source> | </source> | ||
+ | |||
=== <translate>Parameters</translate> === | === <translate>Parameters</translate> === | ||
− | '''texture''': (TextureBase or TextureRegion) <translate></translate> <br/> | + | '''texture''': (TextureBase or TextureRegion) <translate></translate> |
+ | <br/> | ||
+ | |||
=== <translate>Examples</translate> === | === <translate>Examples</translate> === | ||
− | '''Example'''<br/> | + | '''Example''' |
− | + | <br/> | |
+ | <source lang="lua"> | ||
+ | local texture = Texture.new("image.png") | ||
local region = TextureRegion.new(texture, 0, 0, 100, 50) | local region = TextureRegion.new(texture, 0, 0, 100, 50) | ||
Line 23: | Line 34: | ||
stage:addChild(bitmap1) | stage:addChild(bitmap1) | ||
− | stage:addChild(bitmap2)</source> | + | stage:addChild(bitmap2) |
+ | </source> | ||
+ | <br/> | ||
+ | <br/> |
Revision as of 08:39, 16 September 2019
Available since: Gideros 2011.6
Class: Bitmap
Description
Creates a new Bitmap object.
Bitmap.new(texture)
Parameters
texture: (TextureBase or TextureRegion)
Examples
Example
local texture = Texture.new("image.png")
local region = TextureRegion.new(texture, 0, 0, 100, 50)
local bitmap1 = Bitmap.new(texture)
local bitmap2 = Bitmap.new(region)
stage:addChild(bitmap1)
stage:addChild(bitmap2)