User Guide

ADOBE ATMOSPHERE 337
User Guide
Methods
getTexture()
Returns the Texture object attached to the surface.
Code Sample
box = SceneGroup(“./box.aer”).add();
loader = new Object();
loader.timestep = function()
{
if(box.loaded)
{
aTexture = Texture();
aTexture.URL = “http://www.myDomain.com/myHomePage/grass.gif”;
thePrimitive = box.solidObject.rootPrimitive;
theFace = thePrimitive.getFace(0);
theSurfaceTexture = theFace.getSurfaceTexture();
if (theSurfaceTexture.hasTexture)
{
chat.print(“The SurfaceTexture has a texture.”);
chat.print(“Its type is “ + theSurfaceTexture.surfaceTextureType);
}
theSurfaceTexture.sizeU = 2.0;
theSurfaceTexture.sizeV = 2.0;
theSurfaceTexture.offsetU = .25;
theSurfaceTexture.offsetU = .75;
theSurfaceTexture.rotationAngleInDegrees = 45;
theSurfaceTexture.texture = aTexture;
theTexture = theSurfaceTexture.getTexture();
removeAnimator(this);
}
}
addAnimator(loader);
Texture
A Texture module is used to represent the image loaded to be used as a texture on a surface. The actual mapping is
controlled using a SurfaceTexture module. The a string property (“URLString”) controls the source of the image fi le
and another property (“cached”) controls whether the image is cached locally.