Difference between revisions of "Bitmap.new"
From GiderosMobile
Line 9: | Line 9: | ||
Bitmap.new(texture) | Bitmap.new(texture) | ||
</source> | </source> | ||
− | '''texture''': (TextureBase or TextureRegion) ''''''<br/> | + | === Parameters === |
+ | '''texture''': (TextureBase or TextureRegion) <br/> | ||
+ | === Examples === | ||
+ | '''Example'''<br/> | ||
+ | <source lang="lua">local texture = Texture.new("image.png")<br /> | ||
+ | <br /> | ||
+ | local region = TextureRegion.new(texture, 0, 0, 100, 50)<br /> | ||
+ | <br /> | ||
+ | local bitmap1 = Bitmap.new(texture)<br /> | ||
+ | local bitmap2 = Bitmap.new(region)<br /> | ||
+ | <br /> | ||
+ | stage:addChild(bitmap1)<br /> | ||
+ | stage:addChild(bitmap2)<br /></source> |
Revision as of 10:45, 23 August 2018
Available since: Gideros 2011.6
Description
Creates a new `Bitmap` object.
Bitmap.new(texture)
Parameters
texture: (TextureBase or TextureRegion)
Examples
Example
local texture = Texture.new("image.png")<br />
<br />
local region = TextureRegion.new(texture, 0, 0, 100, 50)<br />
<br />
local bitmap1 = Bitmap.new(texture)<br />
local bitmap2 = Bitmap.new(region)<br />
<br />
stage:addChild(bitmap1)<br />
stage:addChild(bitmap2)<br />