Difference between revisions of "Bitmap.new"

From GiderosMobile
m
m
Line 9: Line 9:
  
 
=== Parameters ===
 
=== Parameters ===
'''texture''': (texture) Texture.<br/>
+
'''texture''': (texture) [[Special:MyLanguage/TextureRegion|Texture]].<br/>
  
 
=== Description ===
 
=== Description ===
Line 18: Line 18:
  
 
=== Parameters ===
 
=== Parameters ===
'''textureRegion''': (textureRegion) TextureRegion.<br/>
+
'''textureRegion''': (textureRegion) [[Special:MyLanguage/TextureRegion|TextureRegion]].<br/>
  
 
=== Example ===
 
=== Example ===
Line 30: Line 30:
 
stage:addChild(bitmap2)
 
stage:addChild(bitmap2)
 
</source>
 
</source>
 
  
 
{{Bitmap}}
 
{{Bitmap}}

Revision as of 21:59, 2 January 2021

Available since: Gideros 2011.6
Class: Bitmap

Description

Creates a new Bitmap object.

Bitmap.new(texture)

Parameters

texture: (texture) Texture.

Description

Creates a new Bitmap object.

Bitmap.new(textureRegion)

Parameters

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