Difference between revisions of "TexturePack.loadAsync"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(2 intermediate revisions by 2 users not shown)
Line 4: Line 4:
  
 
=== Description ===
 
=== Description ===
Asynchronously loads a [[TexturePack]] object. This function loads the pre-packed texture atlas created by "Gideros Texture Packer" tool.
+
Asynchronously loads a '''TexturePack''' object. This function loads the pre-packed texture atlas created by "Gideros Texture Packer" tool.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
TexturePack.loadAsync(callback,txtfile,imagefile,filtering,options)
 
TexturePack.loadAsync(callback,txtfile,imagefile,filtering,options)
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===
Line 14: Line 14:
 
'''imagefile''': (string) "Gideros Texture Packer" image file path<br/>
 
'''imagefile''': (string) "Gideros Texture Packer" image file path<br/>
 
'''filtering''': (boolean, default = false) whether or not the texture is filtered, that is smoothing the image '''optional'''<br/>
 
'''filtering''': (boolean, default = false) whether or not the texture is filtered, that is smoothing the image '''optional'''<br/>
'''options''': (table) a table that specifies optional parameters '''optional'''. Currently, "transparentColor" and "format" fields are supported <br/>
+
'''options''': (table) a table that specifies optional parameters '''optional'''. Currently, "transparentColor" and "format" fields are supported<br/>
  
 
{{TexturePack}}
 
{{TexturePack}}

Latest revision as of 14:33, 13 July 2023

Available since: Gideros 2021.9
Class: TexturePack

Description

Asynchronously loads a TexturePack object. This function loads the pre-packed texture atlas created by "Gideros Texture Packer" tool.

TexturePack.loadAsync(callback,txtfile,imagefile,filtering,options)

Parameters

callback: (function) the function will be called with the Texture object as argument or an error as second argument
txtfile: (string) "Gideros Texture Packer" text file path
imagefile: (string) "Gideros Texture Packer" image file path
filtering: (boolean, default = false) whether or not the texture is filtered, that is smoothing the image optional
options: (table) a table that specifies optional parameters optional. Currently, "transparentColor" and "format" fields are supported