public abstract class BaseDisplayObject extends java.lang.Object implements DisplayObject
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
ATT_ALPHA |
protected static java.lang.String |
ATT_ANIMATOR |
protected static java.lang.String |
ATT_BLEND_MODE |
protected static java.lang.String |
ATT_COLOR |
protected static java.lang.String |
ATT_DEBUG |
protected static java.lang.String |
ATT_ORIGIN_AT_CENTER |
protected static java.lang.String |
ATT_ROTATION |
protected static java.lang.String |
ATT_VISIBLE |
protected boolean |
mAlive |
protected float |
mAlpha |
protected boolean |
mAlphaTestEnabled |
protected boolean |
mAutoUpdateBounds |
protected BlendFunc |
mBlendFunc |
protected RectF |
mBounds |
protected boolean |
mBypassCameraClipping |
protected GLColor |
mColor |
protected int |
mDebugFlags |
protected float |
mFrameDuration |
protected boolean |
mHasTransformValues |
protected java.lang.String |
mId |
protected int |
mInvalidateFlags |
protected java.util.ArrayList<Manipulator> |
mManipulators |
protected Maskable |
mMask |
protected Matrix |
mMatrix |
protected int |
mNumManipulators |
protected PointF |
mOrigin |
protected Container |
mParent |
protected boolean |
mPerspectiveEnabled |
protected PointF |
mPivot |
protected PointF |
mPosition |
protected float |
mRotation |
protected float |
mRotationVectorX |
protected float |
mRotationVectorY |
protected float |
mRotationVectorZ |
protected PointF |
mScale |
protected Scene |
mScene |
protected PointF |
mSceneSize |
protected PointF |
mSize |
protected PointF |
mSkew |
protected Matrix |
mTransformMatrix |
protected float[] |
mTransformMatrixValues |
protected UIConstraint |
mUIConstraint |
protected boolean |
mVisible |
protected float |
mZ |
static java.lang.String |
TAG |
FLIP_X, FLIP_YALL, ALPHA, BLEND, BOUNDS, CACHE, CHILDREN, COLOR, DEPTH, FRAME, ORIGIN, PARENT, PARENT_BOUNDS, PERSPECTIVE, PIVOT, POSITION, ROTATION, SCALE, SIZE, SKEW, TEXTURE, TEXTURE_COORDS, TRANSFORM_MATRIX, VERTICES, VISIBILITY, VISUAL| Constructor and Description |
|---|
BaseDisplayObject() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addManipulator(Manipulator manipulator) |
void |
dispose() |
boolean |
draw(GLState glState) |
protected void |
drawBounds(GLState glState) |
protected abstract boolean |
drawChildren(GLState glState) |
protected void |
drawEnd(GLState glState) |
protected void |
drawStart(GLState glState) |
protected void |
drawWireframe(GLState glState) |
float |
getAlpha() |
BlendFunc |
getBlendFunc() |
RectF |
getBounds()
Get the Global Bounds of this object that takes translation, rotation and scale factors into account.
|
GLColor |
getColor() |
int |
getDebugFlags() |
int |
getFps() |
PointF |
getGlobalPosition()
Get global position of this object
|
float |
getHeight() |
java.lang.String |
getId()
for ui
|
BlendFunc |
getInheritedBlendFunc() |
GLColor |
getInheritedColor() |
Manipulator |
getManipulator(int index) |
Maskable |
getMask() |
Matrix |
getMatrix() |
int |
getNumManipulators() |
java.lang.String |
getObjectTree(java.lang.String prefix)
for debugging
|
PointF |
getOrigin() |
Parentable |
getParent() |
protected Matrix |
getParentMatrix() |
PointF |
getPivot() |
PointF |
getPosition() |
float |
getRotation() |
PointF |
getScale() |
Scene |
getScene() |
protected PointF |
getSceneSize()
This is used for 3D projection
|
PointF |
getSize() |
PointF |
getSkew() |
UIConstraint |
getUIConstraint() |
float |
getWidth() |
float |
getX() |
float |
getY() |
float |
getZ() |
void |
globalToLocal(PointF global,
PointF result)
Converts a global point to a local point, without allocating new PointF
|
void |
invalidate() |
void |
invalidate(int flags) |
boolean |
isAlive() |
boolean |
isAlphaTestEnabled() |
boolean |
isAutoUpdateBounds() |
boolean |
isBypassCameraClipping() |
boolean |
isOriginAtCenter() |
boolean |
isPerspectiveEnabled() |
boolean |
isVisible() |
void |
localToGlobal(PointF local,
PointF result)
Converts a local point to a global point, without allocating new PointF
|
void |
move(float dx,
float dy) |
void |
moveTo(float x,
float y) |
void |
onAdded(Container container)
This is called after this object is added to a Container
|
void |
onAddedToScene(Scene scene) |
void |
onCreateChildren(UIManager manager) |
protected void |
onPreConcatParentMatrix() |
void |
onRemoved()
This is called after this object is removed from a Container
|
void |
onRemovedFromScene() |
boolean |
queueEvent(java.lang.Runnable r) |
int |
removeAllManipulators() |
boolean |
removeFromParent() |
boolean |
removeManipulator(Manipulator manipulator) |
void |
rotate(float degreeDelta) |
void |
setAlive(boolean value)
Toggles the heart-beat.
|
void |
setAlpha(float alpha) |
void |
setAlphaTestEnabled(boolean alphaTestEnabled)
Enable Alpha Test.
|
void |
setAutoUpdateBounds(boolean autoUpdateBounds)
This needs to be set to true if using Camera clipping.
|
void |
setBlendFunc(BlendFunc blendFunc) |
void |
setBypassCameraClipping(boolean ignoreCameraClipping) |
void |
setColor(GLColor color) |
void |
setDebugFlags(int flags) |
void |
setFps(int fps) |
void |
setId(java.lang.String id) |
void |
setMask(Maskable mask) |
void |
setOrigin(float x,
float y) |
void |
setOrigin(PointF origin) |
void |
setOriginAtCenter() |
void |
setPerspectiveEnabled(boolean perspectiveEnabled) |
void |
setPivot(float x,
float y) |
void |
setPivot(PointF pivot) |
void |
setPivotAtCenter() |
void |
setPosition(float x,
float y) |
void |
setPosition(PointF position) |
void |
setRotation(float degree) |
void |
setRotationVector(float x,
float y,
float z) |
void |
setScale(float scale) |
void |
setScale(float sx,
float sy) |
void |
setSize(float w,
float h) |
void |
setSize(PointF size) |
void |
setSkew(float kx,
float ky) |
void |
setUIConstraint(UIConstraint uiConstraint) |
void |
setVisible(boolean value) |
void |
setX(float x) |
void |
setXMLAttributes(XmlPullParser xmlParser,
UIManager manager) |
void |
setY(float y) |
void |
setZ(float z)
Set the Z-depth
|
boolean |
shouldDraw(RectF globalViewRect) |
java.lang.String |
toString() |
boolean |
update(int deltaTime) |
RectF |
updateBounds()
Find the global bounds of this object that takes position, scale, rotation, skew...
|
protected void |
updateChildren(int deltaTime) |
protected void |
validate(int flags) |
public static final java.lang.String TAG
protected static final java.lang.String ATT_COLOR
protected static final java.lang.String ATT_ALPHA
protected static final java.lang.String ATT_BLEND_MODE
protected static final java.lang.String ATT_ORIGIN_AT_CENTER
protected static final java.lang.String ATT_ROTATION
protected static final java.lang.String ATT_VISIBLE
protected static final java.lang.String ATT_ANIMATOR
protected static final java.lang.String ATT_DEBUG
protected int mDebugFlags
protected java.lang.String mId
protected PointF mPosition
protected PointF mOrigin
protected PointF mSize
protected PointF mScale
protected PointF mPivot
protected float mRotation
protected float mRotationVectorX
protected float mRotationVectorY
protected float mRotationVectorZ
protected float mZ
protected PointF mSkew
protected Matrix mTransformMatrix
protected float[] mTransformMatrixValues
protected boolean mHasTransformValues
protected boolean mVisible
protected boolean mAlive
protected float mFrameDuration
protected Container mParent
protected Scene mScene
protected Maskable mMask
protected GLColor mColor
protected float mAlpha
protected BlendFunc mBlendFunc
protected boolean mAlphaTestEnabled
protected java.util.ArrayList<Manipulator> mManipulators
protected int mNumManipulators
protected int mInvalidateFlags
protected Matrix mMatrix
protected boolean mAutoUpdateBounds
protected RectF mBounds
protected boolean mBypassCameraClipping
protected boolean mPerspectiveEnabled
protected PointF mSceneSize
protected UIConstraint mUIConstraint
protected abstract boolean drawChildren(GLState glState)
protected PointF getSceneSize()
setPerspectiveEnabled(boolean)public boolean draw(GLState glState)
draw in interface DisplayObjectprotected void drawStart(GLState glState)
protected void drawEnd(GLState glState)
protected void drawWireframe(GLState glState)
protected void drawBounds(GLState glState)
public boolean update(int deltaTime)
update in interface Displayableprotected void updateChildren(int deltaTime)
public final void invalidate()
invalidate in interface Displayablepublic void invalidate(int flags)
invalidate in interface Displayableprotected final void validate(int flags)
public void setAlive(boolean value)
setAlive in interface Displayablecom.funzio.pure2D.IDisplayObject#setAlive(boolean),
update(int)public final boolean isAlive()
isAlive in interface Displayablepublic void setVisible(boolean value)
setVisible in interface Displayablepublic final boolean isVisible()
isVisible in interface Displayablepublic boolean shouldDraw(RectF globalViewRect)
shouldDraw in interface Displayablepublic final PointF getPosition()
getPosition in interface Manipulatablepublic final void setPosition(PointF position)
setPosition in interface Manipulatableposition - the position to setpublic void setPosition(float x,
float y)
setPosition in interface Manipulatableposition - the position to setpublic void setX(float x)
setX in interface Manipulatablepublic final float getX()
getX in interface Manipulatablepublic void setY(float y)
setY in interface Manipulatablepublic final float getY()
getY in interface Manipulatablepublic void setZ(float z)
setZ in interface DisplayablesetAlphaTestEnabled(boolean)public final float getZ()
getZ in interface Displayablepublic void moveTo(float x,
float y)
moveTo in interface Manipulatablepublic void move(float dx,
float dy)
move in interface Manipulatablepublic final PointF getOrigin()
getOrigin in interface Displayablepublic final void setOrigin(PointF origin)
setOrigin in interface Displayableorigin - the origin to set. Origin is the local point and (0,0) by default. Origin is used to define offset of this object and also the center of rotation and scaling.public void setOrigin(float x,
float y)
setOrigin in interface Displayablepublic void setOriginAtCenter()
setOriginAtCenter in interface Displayablepublic boolean isOriginAtCenter()
public PointF getPivot()
getPivot in interface Displayablepublic void setPivot(PointF pivot)
setPivot in interface Displayablepublic void setPivot(float x,
float y)
setPivot in interface Displayablepublic void setPivotAtCenter()
setPivotAtCenter in interface Displayablepublic final PointF getSize()
getSize in interface Manipulatablepublic final float getWidth()
getWidth in interface Manipulatablepublic final float getHeight()
getHeight in interface Manipulatablepublic final void setSize(PointF size)
setSize in interface Manipulatablesize - the size to setpublic void setSize(float w,
float h)
setSize in interface Manipulatablesize - the size to setpublic void setScale(float sx,
float sy)
setScale in interface Manipulatablescreen_scale - the scale to setpublic void setScale(float scale)
setScale in interface Manipulatablescale - the scale to setpublic final PointF getScale()
getScale in interface Manipulatablepublic void setRotation(float degree)
setRotation in interface Manipulatablepublic void rotate(float degreeDelta)
rotate in interface Manipulatablepublic final float getRotation()
getRotation in interface Manipulatablepublic void setRotationVector(float x,
float y,
float z)
public void setSkew(float kx,
float ky)
setSkew in interface Displayablepublic PointF getSkew()
getSkew in interface Displayablepublic final GLColor getColor()
getColor in interface Displayablepublic void setColor(GLColor color)
setColor in interface Displayablecolor - the color to setpublic GLColor getInheritedColor()
getInheritedColor in interface Displayablepublic final BlendFunc getInheritedBlendFunc()
getInheritedBlendFunc in interface Displayablepublic final float getAlpha()
getAlpha in interface Displayablepublic void setAlpha(float alpha)
setAlpha in interface Displayablealpha - the alpha to setpublic final int getFps()
getFps in interface Displayablepublic void setFps(int fps)
setFps in interface Displayablefps - the fps to setpublic boolean addManipulator(Manipulator manipulator)
addManipulator in interface Displayablepublic boolean removeManipulator(Manipulator manipulator)
removeManipulator in interface Displayablepublic int removeAllManipulators()
removeAllManipulators in interface Displayablepublic Manipulator getManipulator(int index)
getManipulator in interface Displayablepublic int getNumManipulators()
getNumManipulators in interface Displayablepublic BlendFunc getBlendFunc()
getBlendFunc in interface Displayablepublic void setBlendFunc(BlendFunc blendFunc)
setBlendFunc in interface DisplayableblendFunc - the blendFunc to setpublic final boolean isAlphaTestEnabled()
public void setAlphaTestEnabled(boolean alphaTestEnabled)
alphaTestEnabled - setZ(float)public final Maskable getMask()
public void setMask(Maskable mask)
public final Scene getScene()
getScene in interface Displayablepublic Parentable getParent()
getParent in interface Displayablepublic final boolean queueEvent(java.lang.Runnable r)
queueEvent in interface Displayablepublic boolean removeFromParent()
removeFromParent in interface Displayablepublic final void localToGlobal(PointF local,
PointF result)
localToGlobal in interface Displayablelocal - result - public final void globalToLocal(PointF global,
PointF result)
globalToLocal in interface Displayableglobal - result - public PointF getGlobalPosition()
public RectF updateBounds()
updateBounds in interface Displayableprotected void onPreConcatParentMatrix()
public final Matrix getMatrix()
protected Matrix getParentMatrix()
public final RectF getBounds()
getBounds in interface DisplayablegetBounds in interface Manipulatablepublic boolean isBypassCameraClipping()
public void setBypassCameraClipping(boolean ignoreCameraClipping)
public final boolean isAutoUpdateBounds()
isAutoUpdateBounds in interface Displayablepublic void setAutoUpdateBounds(boolean autoUpdateBounds)
setAutoUpdateBounds in interface DisplayableautoUpdateBounds - the autoUpdateBounds to setpublic boolean isPerspectiveEnabled()
isPerspectiveEnabled in interface DisplayObjectpublic void setPerspectiveEnabled(boolean perspectiveEnabled)
setPerspectiveEnabled in interface DisplayObjectScene#setDepthRange(float, float)}, {@link #getSceneSize()}public void dispose()
dispose in interface Displayablepublic int getDebugFlags()
Pure2D.DEBUG_FLAG_LOCAL_SHAPE, Pure2D.DEBUG_FLAG_GLOBAL_BOUNDSpublic void setDebugFlags(int flags)
flags - Pure2D.DEBUG_FLAG_SHAPE, Pure2D.DEBUG_FLAG_BOUNDSpublic void onAdded(Container container)
onAdded in interface DisplayObjectpublic void onRemoved()
onRemoved in interface Displayablepublic void onAddedToScene(Scene scene)
onAddedToScene in interface Displayablepublic void onRemovedFromScene()
onRemovedFromScene in interface Displayablepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getObjectTree(java.lang.String prefix)
getObjectTree in interface Displayablepublic java.lang.String getId()
getId in interface Displayablepublic void setId(java.lang.String id)
setId in interface Displayablepublic void setXMLAttributes(XmlPullParser xmlParser,
UIManager manager)
setXMLAttributes in interface DisplayObjectpublic void onCreateChildren(UIManager manager)
onCreateChildren in interface DisplayObjectpublic UIConstraint getUIConstraint()
public void setUIConstraint(UIConstraint uiConstraint)