Class: Image

graphics.tmx. Image


new Image( [init])

A tmx image definition.

A tmx image definition.

Parameters:
Name Type Argument Description
init Object <optional>

A generic object containing properties with which to populate the newly instance. If this argument is null, it is ignored.

Extends

Members


data

The data image informations.


format :string

Used for embedded images, in combination with a data child element. Valid values are file extensions like png, gif, jpg, bmp, etc. (since 0.9)

Type:
  • string

height :number

The image height in pixels (optional).

Type:
  • number

source :string

The reference to the tileset image file (Tiled supports most common image formats).

Type:
  • string

trans :string

Defines a specific color that is treated as transparent (example value: "#FF00FF" for magenta). Up until Tiled 0.12, this value is written out without a # but this is planned to change.

Type:
  • string

width :number

The image width in pixels (optional, used for tile index correction when the image changes)

Type:
  • number

Methods


clone()

Returns a shallow copy of the object.

Inherited From:
Returns:

a shallow copy of the object.


setTo(init)

Sets the members of the object to the specified values.

Parameters:
Name Type Description
init Object

The generic object to initialize the object.

Inherited From:
Returns:

The current object reference.


toObject()

Returns the Object representation of this object.

Overrides:
Returns:

the Object representation of this object.


toString()

Returns the string representation of this object.

Inherited From:
Returns:

the string representation of this object.