Difference between revisions of "Bitmap.new"
From GiderosMobile
m (forgot to add bitmap template to this one) |
m |
||
Line 11: | Line 11: | ||
'''texture''': (TextureBase or TextureRegion) | '''texture''': (TextureBase or TextureRegion) | ||
− | === | + | === Example === |
<source lang="lua"> | <source lang="lua"> | ||
local texture = Texture.new("image.png") | local texture = Texture.new("image.png") | ||
Line 21: | Line 21: | ||
stage:addChild(bitmap2) | stage:addChild(bitmap2) | ||
</source> | </source> | ||
+ | |||
{{Bitmap}} | {{Bitmap}} |
Revision as of 08:18, 4 January 2020
Available since: Gideros 2011.6
Class: Bitmap
Description
Creates a new Bitmap object.
Bitmap.new(texture)
Parameters
texture: (TextureBase or TextureRegion)
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)