Image in Anark Studio 2.5
Instance Properties
| name | type | description |
|---|---|---|
| prototype | Object | The prototype for a class. [from Object] |
| constructor | Object | A reference to the constructor class for the current object instance. [from Object] |
| id | Number | (read only) Unique ID for the asset. [from Asset] |
| type | String | (read only) Type of the asset. [from Asset] |
| name | String | User-defined name for the asset. [from Asset] |
| parent | Object | (read only) Parent object of this asset. [from Asset] |
| active | Boolean | Should this asset be drawn? [from Asset] |
| startLifeTime | Number | Starting time of the asset. [from Asset] |
| endLifeTime | Number | Ending time of the asset. [from Asset] |
| behaviors | Collection | (read only) All Behavior objects attached under this asset. [from Asset] |
| sounds | Collection | (read only) All Sounds objects attached under this asset. [from Asset] |
| music | Collection | (read only) All Music objects attached under this asset. [from Asset] |
| context | TimeContext | (read only) The asset's local TimeContext object. [from Asset] |
| contextType | Number | Type of the TimeContext for this asset. [from Asset] |
| height | Number | (read only) Height of the image. |
| width | Number | (read only) Width of the image. |
| visible | Boolean | Apply this image to its material? |
| remoteSource | String | URL to the source for the image. |
| rotation | Number | Rotation in degrees. |
| positionU | Number | UV horizontal offset. |
| positionV | Number | UV vertical offset. |
| repeatU | Number | Horizontal UV scale for tiling. |
| repeatV | Number | Vertical UV scale for tiling. |
| tilingModeHoriz | Number | Horizontal tiling option. |
| tilingModeVert | Number | Vertical tiling option. |
| materialMode | Number | How to use the image on the material. |
| mappingMode | Number | How to display the image on the material. |
| pivotV | Number | Vertical UV pivot location. |
| pivotU | Number | Horizontal UV pivot location. |
Instance Methods
| name | returns | description |
|---|---|---|
| toLocaleString() | String |
For most objects, the same as toString() unless explicitly overridden.
[from Object]
|
| valueOf() | String |
Returns the internal this value of the object.
[from Object]
|
| hasOwnProperty() | Boolean | Determines if the object/instance itself has the named property or method. [from Object] |
| isPrototypeOf() | Boolean | Determines if the calling object prototype is in the inheritance chain for the supplied argument. [from Object] |
| propertyIsEnumerable() | Boolean |
Determines if the object/instance itself has a property or method of the supplied name which will appear in a for (prop in obj) enumeration.
[from Object]
|
| attach() | (none) | Attach the argument underneath the asset. [from Asset] |
| detach() | (none) | Remove an asset from this asset. [from Asset] |
| copy() | Asset | Create a copy of the asset. [from Asset] |
| toString() | String | Returns a string representation of the object. [from Object] |
Description
The Image object is a type of asset that is used for texture maps included in a material description. An image encapsulates a single picture, allowing for extremely powerful texture mapping behavior.
New images can be created via scripting. The Library asset constructor creates a new instance of the object from a resource in the Anark Studio Library. Images cannot be created using the scripting constructor because there would be no way to assign graphic information to the image. Objects created via scripting are not available to the Anark Studio interface, but they do appear in the finished project.
Library asset constructor syntax
var theImage = new Image( "library://libraryAssetName" [, objectToAttachTo] );
libraryAssetName- required — A String with the name of the asset in the Anark Studio Library from which to create this object.
objectToAttachTo- optional — The String name of the object to which the image will be attached. Images can only be attached to materials. The Image must be attached to a material either now or later in order to appear in the scene during playback.
Image Example
// Create a new image from a jpeg in the library.
theImage = new Image ( "library://Bricks", "material1" );
// Repeat the image.
theImage.repeatU = 2;
theImage.repeatV = 2;