Difference between revisions of "Bitmap.new"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
 +
<translate><br />
 +
Creates a new [[[Bitmap]]] object.<br />
 
<br />
 
<br />
Creates a new `Bitmap` object.<br />
+
<br /></translate>
<br />
 
<br />
 
 
<source lang="lua">
 
<source lang="lua">
 
  Bitmap.new(texture)
 
  Bitmap.new(texture)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''texture''': (TextureBase or TextureRegion) <br/>
+
'''texture''': (TextureBase or TextureRegion) <translate></translate> <br/>
 
=== Examples ===
 
=== Examples ===
 
'''Example'''<br/>
 
'''Example'''<br/>
<source lang="lua">local texture = Texture.new(&quot;image.png&quot;)<br />
+
<source lang="lua">local texture = Texture.new(&quot;image.png&quot;)
<br />
+
 
local region = TextureRegion.new(texture, 0, 0, 100, 50)<br />
+
local region = TextureRegion.new(texture, 0, 0, 100, 50)
<br />
+
 
local bitmap1 = Bitmap.new(texture)<br />
+
local bitmap1 = Bitmap.new(texture)
local bitmap2 = Bitmap.new(region)<br />
+
local bitmap2 = Bitmap.new(region)
<br />
+
 
stage:addChild(bitmap1)<br />
+
stage:addChild(bitmap1)
stage:addChild(bitmap2)<br /></source>
+
stage:addChild(bitmap2)</source>

Revision as of 14:34, 23 August 2018

Available since: Gideros 2011.6

Description


Creates a new [[[Bitmap]]] object.


 Bitmap.new(texture)

Parameters

texture: (TextureBase or TextureRegion)

Examples

Example

local texture = Texture.new(&quot;image.png&quot;)

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)