Fork me on GitHub
View source

package haxepunk.graphics.tile

class Backdrop


extends Graphic

A background texture that can be repeated horizontally and vertically when drawn. Really useful for parallax backgrounds, textures, etc.

Constructor

View source

new (source : ImageType, repeatX : Bool = true, repeatY : Bool = true) : Void

Constructor.


Parameters:
source   

Source texture.

repeatX   

Repeat horizontally.

repeatY   

Repeat vertically.

Variables

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.

Functions

View source

centerOrigin () : Void

Centers the origin of this Backdrop based on the dimensions of it's graphic.