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
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.
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
new (source : ImageType, clipRect : Rectangle) : Void
Constructor.
Parameters:
source | Source image. | |
clipRect | Optional rectangle defining area of the source image to draw. |
Variables
Functions
centerOO () : Void
Centers the Image's originX/Y to its center, and negates the offset by the same amount.