Difference between revisions of "Bitmap.new"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
Line 7: Line 7:
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
Bitmap.new(texture)
 
Bitmap.new(texture)
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===
Line 22: Line 22:
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
Bitmap.new(textureRegion)
 
Bitmap.new(textureRegion)
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===
Line 36: Line 36:
 
stage:addChild(bitmap1)
 
stage:addChild(bitmap1)
 
stage:addChild(bitmap2)
 
stage:addChild(bitmap2)
</source>
+
</syntaxhighlight>
  
 
{{Bitmap}}
 
{{Bitmap}}

Latest revision as of 15:27, 13 July 2023

Available since: Gideros 2011.6
Class: Bitmap

Description

Creates a new Bitmap object using a Texture.

Bitmap.new(texture)

Parameters

texture: (texture) the bitmap texture



Available since: Gideros 2012.8.2
Class: Bitmap

Description

Creates a new Bitmap object using a TextureRegion.

Bitmap.new(textureRegion)

Parameters

textureRegion: (textureRegion) the bitmap texture region

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)