Difference between revisions of "Bitmap.new"

From GiderosMobile
Line 9: Line 9:
  
 
=== Parameters ===
 
=== Parameters ===
'''texture''': (TextureBase or TextureRegion)
+
'''texture''': (texture) TextureBase or TextureRegion.<br/>
  
 
=== Example ===
 
=== Example ===

Revision as of 00:52, 10 December 2020

Available since: Gideros 2011.6
Class: Bitmap

Description

Creates a new Bitmap object.

Bitmap.new(texture)

Parameters

texture: (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)