Difference between revisions of "Bitmap.new"
From GiderosMobile
Line 15: | Line 15: | ||
=== <translate>Examples</translate> === | === <translate>Examples</translate> === | ||
'''Example'''<br/> | '''Example'''<br/> | ||
− | <source lang="lua">local texture = Texture.new( | + | <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) |
Revision as of 11:48, 7 November 2018
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)