Skip to content

ImageAsset Guide

MelvMay-GG edited this page Feb 21, 2013 · 19 revisions

Introduction

All assets are known engine types that allow instances to be created at runtime. The "ImageAsset", like all assets, is derived from a base type of "AssetBase". That means it includes all the fields from that type as well as adding its own fields specific to itself.

TorqueScript Bindings

ImageAsset AssetBase

Exposed Fields

The ImageAsset type exposes the following fields in addition to those it inherits:

  • ImageFile
  • Force16bit
  • FilterMode
  • ExplicitMode
  • CellRowOrder
  • CellOffsetX
  • CellOffsetY
  • CellStrideX
  • CellStrideY
  • CellCountX
  • CellCountY
  • CellWidth
  • CellHeight

In the list above, only "ImageFile" is mandatory, all others are completely optional.

Here's an example of the most basic form of an ImageAsset where only the mandatory "ImageFile" field is specified:

<ImageAsset
    AssetName="NinjaImages"
    ImageFile="Ninjas.png"	
/>

This would produce an asset known as "NinjaImages" and produce a single texture from the image "Ninjas.png" which it expects to be located alongside where the XML ImageAsset file is.

The following is a complete description of each of these fields.

ImageFile (string - File-path)

Clone this wiki locally