Fork me on GitHub
View source

package com.haxepunk.graphics

class Graphiclist


extends Graphic

A Graphic that can contain multiple Graphics of one or various types. Useful for drawing sprites with multiple different parts, etc.

Constructor

View source

new (graphic : Array<Graphic>) : Void

Constructor.


Parameters:
graphic   

Graphic objects to add to the list.

Variables

read only children : Array<Graphic>

All Graphics in this list.

read only count : Int

Amount of Graphics in this list.

Functions

View source

add (graphic : Graphic) : Graphic

Adds the Graphic to the list.


Parameters:
graphic   

The Graphic to add.


Returns:

The added Graphic.

View source

destroy () : Void

Destroys the list of graphics

View source

get (i : Int) : Graphic

Returns the Graphic from the list.


Parameters:
i   

The index of the array.


Returns:

The graphic in n index.

View source

remove (graphic : Graphic) : Graphic

Removes the Graphic from the list.


Parameters:
graphic   

The Graphic to remove.


Returns:

The removed Graphic.

View source

removeAll () : Void

Removes all Graphics from the list.

View source

removeAt (index : Int = 0) : Void

Removes the Graphic from the position in the list.


Parameters:
index   

Index to remove.