Difference between revisions of "Bitmap.new"

From GiderosMobile
m (formatting)
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[Bitmap]]<br/>
  
<languages />
+
=== Description ===
 +
Creates a new '''Bitmap''' object using a '''[[Texture]]'''.
 +
<syntaxhighlight lang="lua">
 +
Bitmap.new(texture)
 +
</syntaxhighlight>
  
'''<translate>Available since</translate>:''' Gideros 2011.6
+
=== Parameters ===
<br/>
+
'''texture''': (texture) the bitmap texture<br/>
  
'''<translate>Class</translate>:''' [[Special:MyLanguage/Bitmap|Bitmap]]
+
----
<br/>
 
  
=== <translate>Description</translate> ===
 
<translate>
 
Creates a new [[Special:MyLanguage/Bitmap|Bitmap]] object.
 
</translate>
 
  
<source lang="lua">
+
'''Available since:''' Gideros 2012.8.2<br/>
Bitmap.new(texture)
+
'''Class:''' [[Bitmap]]<br/>
</source>
 
  
=== <translate>Parameters</translate> ===
+
=== Description ===
'''texture''': (TextureBase or TextureRegion) <translate></translate>
+
Creates a new '''Bitmap''' object using a '''[[TextureRegion]]'''.
<br/>
+
<syntaxhighlight lang="lua">
 +
Bitmap.new(textureRegion)
 +
</syntaxhighlight>
  
=== <translate>Examples</translate> ===
+
=== Parameters ===
'''Example'''
+
'''textureRegion''': (textureRegion) the bitmap texture region<br/>
<br/>
 
  
<source lang="lua">
+
=== Example ===
 +
<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 32: Line 34:
 
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(bitmap1)
 
stage:addChild(bitmap2)
 
stage:addChild(bitmap2)
</source>
+
</syntaxhighlight>
<br/>
+
 
<br/>
+
{{Bitmap}}

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)