Difference between revisions of "Bitmap.new"
From GiderosMobile
Line 2: | Line 2: | ||
'''Available since:''' Gideros 2011.6<br/> | '''Available since:''' Gideros 2011.6<br/> | ||
=== Description === | === Description === | ||
+ | <translate><br /> | ||
+ | Creates a new [[[Bitmap]]] object.<br /> | ||
<br /> | <br /> | ||
− | + | <br /></translate> | |
− | < | ||
− | |||
<source lang="lua"> | <source lang="lua"> | ||
Bitmap.new(texture) | Bitmap.new(texture) | ||
</source> | </source> | ||
=== Parameters === | === Parameters === | ||
− | '''texture''': (TextureBase or TextureRegion) | + | '''texture''': (TextureBase or TextureRegion) <translate></translate> <br/> |
=== Examples === | === Examples === | ||
'''Example'''<br/> | '''Example'''<br/> | ||
− | <source lang="lua">local texture = Texture.new("image.png") | + | <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) |
− | + | ||
− | local bitmap1 = Bitmap.new(texture) | + | local bitmap1 = Bitmap.new(texture) |
− | local bitmap2 = Bitmap.new(region) | + | local bitmap2 = Bitmap.new(region) |
− | + | ||
− | stage:addChild(bitmap1) | + | stage:addChild(bitmap1) |
− | stage:addChild(bitmap2) | + | stage:addChild(bitmap2)</source> |
Revision as of 13:34, 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")
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)