Fork me on GitHub
View source

package haxepunk.graphics

class Image


extends Graphic
extended by Text, TiledImage, Spritemap

Performance-optimized non-animated image. Can be drawn to the screen with transformations.

Static functions

View source

static createCircle (radius : Int, color : Color = 0xFFFFFF, alpha : Float = 1) : Image

Creates a new circle Image.


Parameters:
radius   

Radius of the circle.

color   

Color of the circle.

alpha   

Alpha of the circle.


Returns:

A new Image object of a circle.

View source

static createRect (width : Int, height : Int, color : Color = 0xFFFFFF, alpha : Float = 1) : Image

Creates a new rectangle Image.


Parameters:
width   

Width of the rectangle.

height   

Height of the rectangle.

color   

Color of the rectangle.

alpha   

Alpha of the rectangle.


Returns:

A new Image object of a rectangle.

Constructor

View source

new (source : ImageType, clipRect : Rectangle) : Void

Constructor.


Parameters:
source   

Source image.

clipRect   

Optional rectangle defining area of the source image to draw.

Variables

angle : Float

Rotation of the image, in degrees.

read only height : Int

Height of the image.

scale : Float

Scale of the image, effects both x and y scale.

scaleX : Float

X scale of the image.

scaleY : Float

Y scale of the image.

scaledHeight : Float

The scaled height of the image.

scaledWidth : Float

The scaled width of the image.

read only width : Int

Width of the image.

Functions

View source

centerOO () : Void

Centers the Image's originX/Y to its center, and negates the offset by the same amount.

View source

centerOrigin () : Void

Centers the Image's originX/Y to its center.

View source

toString () : String