Texture

Simple wrapper for the texture class.
Return to Index
static new ( string filename )
__gc ( )
__eq ( am.texture rhs ) -> ( boolean )
filename ( ) -> ( string )
filename ( string filename ) -> ( am.code )
is_loaded ( ) -> ( boolean )
reload ( ) -> ( am.code )
width ( ) -> ( integer )
height ( ) -> ( integer )
bytes_per_pixel ( ) -> ( integer )
gl_format ( ) -> ( integer )
static new ( string filename )
Creates a new texture using the given filename.
Parameters:
string filename : Path to the texture.
__gc ( )
Releases the reference counter on the texture.
__eq ( am.texture rhs ) -> ( boolean )
Compares this texture with another texture object.
Parameters:
am.texture rhs : The other sprite to compare with.
Returns:
boolean : True if they are the same object.
filename ( ) -> ( string )
Returns the filename of where the texture was loaded.
Returns:
string : The filename of the texture.
filename ( string filename ) -> ( am.code )
Sets the texture from the given filename. The filename is relative data folder.
Parameters:
string filename : The filename to load from.
Returns:
am.code : Return codes:
success The texture loaded the new file successfully.
file_not_found Texture didn't load because the file could not be found.
texture_load_failed Texture didn't load because there was an issue with the file.
is_loaded ( ) -> ( boolean )
Returns true when the texture has loaded successfully.
Returns:
boolean : True when the texture is loaded.
reload ( ) -> ( am.code )
Attempts to reload the texture from its currently set filename.
Returns:
am.code : Return codes:
success The texture loaded the new file successfully.
file_not_found Texture didn't load because the file could not be found.
texture_load_failed Texture didn't load because there was an issue with the file.
width ( ) -> ( integer )
Returns the pixel width of the texture. Returns 0 if the texture isn't loaded.
Returns:
integer : The width of the texture.
height ( ) -> ( integer )
Returns the pixel height of the texture. Returns 0 if the texture isn't loaded.
Returns:
integer : The height of the texture.
bytes_per_pixel ( ) -> ( integer )
Returns the number of bytes per pixel. Returns 0 if the texture isn't loaded.
Returns:
integer : The bytes per pixel of the texture.
gl_format ( ) -> ( integer )
Returns the OpenGL format. Returns 0 if the texture isn't loaded. Not likely to be useful in many cases but it's here.
Returns:
integer : The bytes per pixel of the texture.