Difference between revisions of "Bitmap.new"

From GiderosMobile
(mostly formatting :-) and removed language)
Line 1: Line 1:
 +
__NOTOC__
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Class:''' [[Bitmap]]<br/>
 
'''Class:''' [[Bitmap]]<br/>
  
 
=== Description ===
 
=== Description ===
Creates a new [[Special:MyLanguage/Bitmap|Bitmap]] object.
+
Creates a new '''Bitmap''' object using a '''[[Texture]]'''.
 
<source lang="lua">
 
<source lang="lua">
 
Bitmap.new(texture)
 
Bitmap.new(texture)
Line 9: Line 10:
  
 
=== Parameters ===
 
=== Parameters ===
'''texture''': [[Special:MyLanguage/TextureRegion|Texture]].<br/>
+
'''texture''': (texture) the bitmap texture<br/>
 +
 
 +
----
 +
 
 +
 
 +
'''Available since:''' Gideros 2012.8.2<br/>
 +
'''Class:''' [[Bitmap]]<br/>
  
 
=== Description ===
 
=== Description ===
Creates a new [[Special:MyLanguage/Bitmap|Bitmap]] object.
+
Creates a new '''Bitmap''' object using a '''[[TextureRegion]]'''.
 
<source lang="lua">
 
<source lang="lua">
 
Bitmap.new(textureRegion)
 
Bitmap.new(textureRegion)
Line 18: Line 25:
  
 
=== Parameters ===
 
=== Parameters ===
'''textureRegion''': [[Special:MyLanguage/TextureRegion|TextureRegion]].<br/>
+
'''textureRegion''': (textureRegion) the bitmap texture region<br/>
  
 
=== Example ===
 
=== Example ===

Revision as of 04:35, 9 January 2021

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)