Difference between revisions of "Bitmap.new"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Available since:''' Gideros 2011.6<br/>
=== <translate>Description</translate> ===
+
'''Class:''' [[Bitmap]]<br/>
<translate><br />
 
Creates a new [[Special:MyLanguage/Bitmap|Bitmap]] object.<br />
 
<br />
 
<br /></translate>
 
<source lang="lua">
 
Bitmap.new(texture)
 
</source>
 
=== <translate>Parameters</translate> ===
 
'''texture''': (TextureBase or TextureRegion) <translate></translate> <br/>
 
=== <translate>Examples</translate> ===
 
'''Example'''<br/>
 
<source lang="lua">local texture = Texture.new(&quot;image.png&quot;)
 
  
 +
=== Description ===
 +
Creates a new '''Bitmap''' object using a '''[[Texture]]'''.
 +
<syntaxhighlight lang="lua">
 +
Bitmap.new(texture)
 +
</syntaxhighlight>
 +
 +
=== Parameters ===
 +
'''texture''': (texture) the bitmap texture<br/>
 +
 +
----
 +
 +
 +
'''Available since:''' Gideros 2012.8.2<br/>
 +
'''Class:''' [[Bitmap]]<br/>
 +
 +
=== Description ===
 +
Creates a new '''Bitmap''' object using a '''[[TextureRegion]]'''.
 +
<syntaxhighlight lang="lua">
 +
Bitmap.new(textureRegion)
 +
</syntaxhighlight>
 +
 +
=== Parameters ===
 +
'''textureRegion''': (textureRegion) the bitmap texture region<br/>
 +
 +
=== Example ===
 +
<syntaxhighlight lang="lua">
 +
local texture = Texture.new("image.png")
 
local region = TextureRegion.new(texture, 0, 0, 100, 50)
 
local region = TextureRegion.new(texture, 0, 0, 100, 50)
  
 
local bitmap1 = Bitmap.new(texture)
 
local bitmap1 = Bitmap.new(texture)
 
local bitmap2 = Bitmap.new(region)
 
local bitmap2 = Bitmap.new(region)
 +
stage:addChild(bitmap1)
 +
stage:addChild(bitmap2)
 +
</syntaxhighlight>
  
stage:addChild(bitmap1)
+
{{Bitmap}}
stage:addChild(bitmap2)</source>
 

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