Bitmap.new: Difference between revisions

From GiderosMobile
mNo edit summary
No edit summary
 
(5 intermediate revisions by 3 users not shown)
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">
<syntaxhighlight lang="lua">
Bitmap.new(texture)
Bitmap.new(texture)
</source>
</syntaxhighlight>


=== Parameters ===
=== Parameters ===
'''texture''': (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">
<syntaxhighlight lang="lua">
Bitmap.new(textureRegion)
Bitmap.new(textureRegion)
</source>
</syntaxhighlight>


=== Parameters ===
=== Parameters ===
'''textureRegion''': (textureRegion) [[Special:MyLanguage/TextureRegion|TextureRegion]].<br/>
'''textureRegion''': (textureRegion) the bitmap texture region<br/>


=== Example ===
=== 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 29: Line 35:
stage:addChild(bitmap1)
stage:addChild(bitmap1)
stage:addChild(bitmap2)
stage:addChild(bitmap2)
</source>
</syntaxhighlight>
 
=== See also ===
'''[[Buffer.new]]'''


{{Bitmap}}
{{Bitmap}}

Latest revision as of 19:43, 9 October 2026

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)

See also

Buffer.new