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 Colorcolorprotected floatheightfloat[]modelMatrixA matrix used by this model.protected floatwidth-
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 voiddraw(int frame)Draws the drawable on the given frame.voidrecalculateMatrix()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:DisplayObjectRecalculates the matrix with it's current transformations.- Overrides:
recalculateMatrixin classDisplayObject
-
draw
public void draw(int frame)
Description copied from interface:DrawableDraws the drawable on the given frame.- Specified by:
drawin interfaceDrawable- Overrides:
drawin classDisplayObject
-
-