bool valid
This value will be true if the object contains valid data.

vec2 center
The current position of the center of the image. If the image is attached to a body this is the location in body local coordinates, otherwise it is the position in the world.

uint id
The id of this image. This id is unique in the scene.

void select()
Selects the image.

void deselect()
Deselects the image.

bool isSelected()
Returns true if the image is currently selected.

string getName()
Returns the name of the image.

void setName(string)
Sets the name of the image. Names will be included in the saved file so that items can be identified when loading the scene into another program.

The same name can be given to more than one item.

body getBody()
Gets the body this image is attached to, if any. You should always check the returned body for validity with the body's valid() function before attempting to use it.

void setBody(int bodyId)
Sets the body this image should be attached to. Giving zero as the bodyId will cause the image to be not attached to any body.

void setBody(body)
Sets the body this image should be attached to.

string getFile()
Returns the full path of the file this image was loaded from.

void setFile(string)
Sets the file to load the image from and reloads it. If the image is not found or cannot be loaded, a default 'not found' image will be shown instead.

void setCenter(float, float)
Sets the location of the center of the image in the world.

void setCenter(vec2)
Sets the location of the center of the image in the world.

void setAngle(float)
Sets the angle of the image.

void setScale(float)
Same as setHeight(float)

void setHeight(float)
Sets the height of the image in world units.

void setAspectScale(float)
Sets the aspect scale of the image. The width of the image will be multiplied by this value.

void setOpacity(float)
Sets the opacity of the image. A value of zero means the image will not be visible, and a value of 1 means the image will be fully opaque.

void setFlip(int)
Sets whether the image should be flipped horizontally. To get the effect of flipping vertically, you can set this to true and rotate the image 180 degrees.

void setFilter(int)
Sets the magnification filter applied to the image texture. This can be one of the following values:

void setRenderOrder(float)
Sets the rendering order for this image. Images will be rendered in ascending order.

void setColorTint(int red, int green, int blue, int alpha)
Sets a color tint for the image. Both the image opacity and the alpha of the color tint will be used when rendering the image.

void setColorTint(color)
Sets a color tint for the image. Both the image opacity and the alpha of the color tint will be used when rendering the image.

vec2 getCenter()
Returns the current position of the center of the image. If the image is attached to a body this is the location in body local coordinates, otherwise it is the position in the world.

float getAngle()
Returns the angle of the image in radians.

float getScale()
Returns the scale of the image. A scale of 1 means that the vertical height of the image is 1 unit in the physics world.

float getAspectScale()
Returns the aspect scale of the image.

float getOpacity()
Returns the opacity of the image. A value of zero means the image will not be visible, and a value of 1 means the image will be fully opaque.

bool getFlip()
Returns true if the image should be flipped horizontally.

int getFilter()
Returns the magnification filter applied to the image texture. This can be one of the following values:

float getRenderOrder()
Returns the rendering order for this image. Images will be rendered in ascending order.

int getPixelWidth()
Returns the width of the image in pixels.

int getPixelHeight()
Returns the height of the image in pixels.

color getColorTint()
Returns the color tint value of the image.

void delete()
Deletes the image.

string[] getCustomProperties()
Returns an array of the names of all custom properties for which a value actually exists.

bool hasCustomProperty(string propertyName)
Returns true if a value exists for the named property.

string getCustomPropertyType(string propertyName)
Returns the type of the named custom property. This will be one of int, float, string, vec2 or bool.

int getCustomInt(string propertyName, int defaultValue = 0)
Returns the value of the named custom property if it exists. If not, the optional default value will be returned. You can use hasCustomProperty to check if a value exists.

float getCustomFloat(string propertyName, float defaultValue = 0)
Returns the value of the named custom property if it exists. If not, the optional default value will be returned. You can use hasCustomProperty to check if a value exists.

string getCustomString(string propertyName, string defaultValue = "")
Returns the value of the named custom property if it exists. If not, the optional default value will be returned. You can use hasCustomProperty to check if a value exists.

vec2 getCustomVec2(string propertyName, vec2 defaultValue)
Returns the value of the named custom property if it exists. If not, the given default value will be returned. You can use hasCustomProperty to check if a value exists.

vec2 getCustomVec2(string propertyName)
Returns the value of the named custom property if it exists. If not, the vector 0,0 will be returned.

bool getCustomBool(string propertyName, bool defaultValue = false)
Returns the value of the named custom property if it exists. If not, the optional default value will be returned. You can use hasCustomProperty to check if a value exists.

vec2 getCustomColor(string propertyName, color defaultValue)
Returns the value of the named custom property if it exists. If not, the given default value will be returned. You can use hasCustomProperty to check if a value exists.

vec2 getCustomColor(string propertyName)
Returns the value of the named custom property if it exists. If not, the color 255,255,255,255 will be returned.

void setCustomInt(string propertyName, int)
Sets the value of the named custom property.

void setCustomFloat(string propertyName, float)
Sets the value of the named custom property.

void setCustomString(string propertyName, string)
Sets the value of the named custom property.

void setCustomVec2(string propertyName, vec2)
Sets the value of the named custom property.

void setCustomBool(string propertyName, bool)
Sets the value of the named custom property.

void setCustomColor(string propertyName, color)
Sets the value of the named custom property.

void clearCustomProperty(string propertyName)
Removes all values for the named custom property.