Adobe ATMOSPHERE User Manual page 350

Table of Contents

Advertisement

338
APPENDIX E
Global Methods
Texture()
The Texture constructor function, creates a new texture object.
tex = Texture();
Properties
type
The type of object, returned as "Application".
tex = Texture();
chat.print(tex.type); // prints "Texture" to the chat console
cached
A boolean fl ag that determines if the image fi le loaded by a Texture object should be cached by the Player
application. By default this is set to true.
tex = Texture();
tex.cached = true;
URL
The URL path of an image fi le to be loaded as a texture. Supports .PNG, .JPG, and .GIF graphic fi le formats.
Note that the URL for a given texture can only be set once; attempting to change the URL will cause a JavaScript
error. If it is desired to swap textures for a Surface Texture, create numerous texture objects with unique URL's,
and then change the "SurfaceTexture.texture" property to reference any of the texture objects.
// texture object with absolute URL
tex1 = Texture();
tex1.URL = "http://myDomain.com/myHomePage/grass.gif";
// texture object with relative URL
tex2 = Texture();
tex2.URL = "./grid.jpg";
Methods
restartTextureLoad()
Reloads the image fi le designated by the Texture object's URL.
tex = Texture();
tex.URL = "face.png";
// ...
tex.restartTextureLoad();

Advertisement

Table of Contents
loading

Table of Contents