Difference between revisions of "Bitmap.new"

From GiderosMobile
m (formatting)
(----)
Line 1: Line 1:
__NOTOC__
+
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[Bitmap]]<br/>
  
<languages />
+
=== Description ===
 
 
'''<translate>Available since</translate>:''' Gideros 2011.6
 
<br/>
 
 
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/Bitmap|Bitmap]]
 
<br/>
 
 
 
=== <translate>Description</translate> ===
 
<translate>
 
 
Creates a new [[Special:MyLanguage/Bitmap|Bitmap]] object.
 
Creates a new [[Special:MyLanguage/Bitmap|Bitmap]] object.
</translate>
 
  
 
<source lang="lua">
 
<source lang="lua">
Line 18: Line 9:
 
</source>
 
</source>
  
=== <translate>Parameters</translate> ===
+
=== Parameters ===
'''texture''': (TextureBase or TextureRegion) <translate></translate>
+
'''texture''': (TextureBase or TextureRegion)  
<br/>
 
 
 
=== <translate>Examples</translate> ===
 
'''Example'''
 
<br/>
 
  
 +
=== Examples ===
 
<source lang="lua">
 
<source lang="lua">
 
local texture = Texture.new("image.png")
 
local texture = Texture.new("image.png")
Line 32: Line 19:
 
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>
 
</source>
<br/>
+
 
 +
----
 +
{{Special:PrefixIndex/Bitmap}}
 
<br/>
 
<br/>

Revision as of 16:32, 2 December 2019

Available since: Gideros 2011.6
Class: Bitmap

Description

Creates a new Bitmap object.

Bitmap.new(texture)

Parameters

texture: (TextureBase or TextureRegion)

Examples

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)