Difference between revisions of "Bitmap.new"

From GiderosMobile
(Undo revision 14878 by MoKaLux (talk))
Tag: Undo
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Bitmap]]
+
__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]]'''.
 +
<syntaxhighlight lang="lua">
 +
Bitmap.new(texture)
 +
</syntaxhighlight>
 +
 
 +
=== Parameters ===
 +
'''texture''': (texture) the bitmap texture<br/>
 +
 
 +
----
  
<source lang="lua">
+
 
Bitmap.new(texture)
+
'''Available since:''' Gideros 2012.8.2<br/>
</source>
+
'''Class:''' [[Bitmap]]<br/>
 +
 
 +
=== Description ===
 +
Creates a new '''Bitmap''' object using a '''[[TextureRegion]]'''.
 +
<syntaxhighlight lang="lua">
 +
Bitmap.new(textureRegion)
 +
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===
'''texture''': (TextureBase or TextureRegion)  
+
'''textureRegion''': (textureRegion) the bitmap texture region<br/>
  
=== Examples ===
+
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
local texture = Texture.new("image.png")
 
local texture = Texture.new("image.png")
 
local region = TextureRegion.new(texture, 0, 0, 100, 50)
 
local region = TextureRegion.new(texture, 0, 0, 100, 50)
Line 22: Line 36:
 
stage:addChild(bitmap1)
 
stage:addChild(bitmap1)
 
stage:addChild(bitmap2)
 
stage:addChild(bitmap2)
</source>
+
</syntaxhighlight>
  
----
+
{{Bitmap}}
{{Special:PrefixIndex/Bitmap}}
 
<br/>
 

Latest revision as of 14: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)