Package com.nevergarden.myna.display
Class Quad
- java.lang.Object
-
- com.nevergarden.myna.events.EventDispatcher
-
- com.nevergarden.myna.display.DisplayObject
-
- com.nevergarden.myna.display.Quad
-
- All Implemented Interfaces:
Drawable
- Direct Known Subclasses:
Sprite
,TPSpriteAnimation
public class Quad extends DisplayObject implements Drawable
A simple quad drawing a rectangular color.
-
-
Field Summary
Fields Modifier and Type Field Description protected Color
color
protected float
height
float[]
modelMatrix
A matrix used by this model.protected float
width
-
Fields inherited from class com.nevergarden.myna.display.DisplayObject
parent, pivot, position, rotation, scale, transform
-
Fields inherited from class com.nevergarden.myna.events.EventDispatcher
eventListeners
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
draw(int frame)
Draws the drawable on the given frame.void
recalculateMatrix()
Recalculates the matrix with it's current transformations.-
Methods inherited from class com.nevergarden.myna.display.DisplayObject
getPosition, removeFromParent, rotate, setLocalX, setLocalY, setParent, setPivot, setPivotX, setPivotY, setPosition, setRotation, setScale, setScaleX, setScaleY
-
Methods inherited from class com.nevergarden.myna.events.EventDispatcher
addEventListener, dispatchEvent, dispatchEventWith, dispatchEventWith, dispose, hasEventListener, invokeEvent, removeEventListener, removeEventListeners
-
-
-
-
Field Detail
-
color
protected final Color color
-
width
protected final float width
-
height
protected final float height
-
modelMatrix
public float[] modelMatrix
A matrix used by this model.
-
-
Constructor Detail
-
Quad
public Quad(Color color, float width, float height)
Default Constructor.
-
-
Method Detail
-
recalculateMatrix
public void recalculateMatrix()
Description copied from class:DisplayObject
Recalculates the matrix with it's current transformations.- Overrides:
recalculateMatrix
in classDisplayObject
-
draw
public void draw(int frame)
Description copied from interface:Drawable
Draws the drawable on the given frame.- Specified by:
draw
in interfaceDrawable
- Overrides:
draw
in classDisplayObject
-
-