Difference between revisions of "Bitmap.new"

From GiderosMobile
m (forgot to add bitmap template to this one)
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
Creates a new [[Special:MyLanguage/Bitmap|Bitmap]] object.
 
Creates a new [[Special:MyLanguage/Bitmap|Bitmap]] object.
 
 
<source lang="lua">
 
<source lang="lua">
 
Bitmap.new(texture)
 
Bitmap.new(texture)
Line 23: Line 22:
 
</source>
 
</source>
  
----
+
{{Bitmap}}
{{Special:PrefixIndex/Bitmap}}
 
<br/>
 

Revision as of 21:03, 11 December 2019

Available since: Gideros 2011.6
Class: Bitmap

Description

Creates a new Bitmap object.

Bitmap.new(texture)

Parameters

texture: (TextureBase or TextureRegion)

Examples

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)