Difference between revisions of "Bitmap.new"

From GiderosMobile
(mostly formatting :-) and removed language)
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Creates a new '''Bitmap''' object using a '''[[Texture]]'''.
 
Creates a new '''Bitmap''' object using a '''[[Texture]]'''.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
Bitmap.new(texture)
 
Bitmap.new(texture)
 
</source>
 
</source>
Line 20: Line 20:
 
=== Description ===
 
=== Description ===
 
Creates a new '''Bitmap''' object using a '''[[TextureRegion]]'''.
 
Creates a new '''Bitmap''' object using a '''[[TextureRegion]]'''.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
Bitmap.new(textureRegion)
 
Bitmap.new(textureRegion)
 
</source>
 
</source>
Line 28: Line 28:
  
 
=== 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)

Revision as of 14:26, 13 July 2023

Available since: Gideros 2011.6
Class: Bitmap

Description

Creates a new Bitmap object using a Texture. <syntaxhighlight lang="lua"> Bitmap.new(texture) </source>

Parameters

texture: (texture) the bitmap texture



Available since: Gideros 2012.8.2
Class: Bitmap

Description

Creates a new Bitmap object using a TextureRegion. <syntaxhighlight lang="lua"> Bitmap.new(textureRegion) </source>

Parameters

textureRegion: (textureRegion) the bitmap texture region

Example

<syntaxhighlight lang="lua"> 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) </source>