Difference between revisions of "TexturePack.loadAsync"

From GiderosMobile
(Created page with "__NOTOC__ '''<translate>Available since</translate>:''' Gideros 2021.9<br/> '''<translate>Class</translate>:''' TexturePack<br/> === Descr...")
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
+
'''Available since:''' Gideros 2021.9<br/>
'''<translate>Available since</translate>:''' Gideros 2021.9<br/>
+
'''Class:''' [[TexturePack]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/TexturePack|TexturePack]]<br/>
 
  
 
=== Description ===
 
=== Description ===
Asynchronously loads a [[TexturePack|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">
 
<source lang="lua">
 
TexturePack.loadAsync(callback,txtfile,imagefile,filtering,options)
 
TexturePack.loadAsync(callback,txtfile,imagefile,filtering,options)
Line 11: Line 10:
  
 
=== Parameters ===
 
=== Parameters ===
'''callback''': (function) <translate>The function will be called with the Texture object as argument or an error as second argument.</translate><br/>
+
'''callback''': (function) the function will be called with the Texture object as argument or an error as second argument<br/>
'''txtfile''': (string) <translate></translate> <br/>
+
'''txtfile''': (string) "Gideros Texture Packer" text file path<br/>
'''imagefile''': (string) <translate></translate> <br/>
+
'''imagefile''': (string) "Gideros Texture Packer" image file path<br/>
'''filtering''': (boolean, default = false) <translate>whether or not the texture is filtered</translate> <br/>
+
'''filtering''': (boolean, default = false) whether or not the texture is filtered, that is smoothing the image '''optional'''<br/>
'''options''': (table, optional) <translate>a table that specifies optional parameters. Currently, "transparentColor" and "format" fields are supported</translate> <br/>
+
'''options''': (table) a table that specifies optional parameters '''optional'''. Currently, "transparentColor" and "format" fields are supported <br/>
  
 
{{TexturePack}}
 
{{TexturePack}}

Revision as of 01:22, 30 January 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