|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.ucm.look.data.WorldEntity
public class WorldEntity
A world entity
Constructor Summary | |
---|---|
WorldEntity(EntityData data)
|
Method Summary | |
---|---|
void |
addCameraListener(CameraListener c)
Adds a camera listener to this entity, and makes this entity focusable |
void |
addTouchListener(TouchListener t)
Adds a touch listener to this entity, and makes this entity touchable |
void |
cameraEntered()
Camera pointed to this entity |
void |
cameraExited()
Camera pointed to this entity |
void |
draw(Canvas c)
Draws the element in the canvas |
void |
draw(GL10 gl)
Draws the element in the canvas |
void |
drawTouchableArea(Canvas c,
Paint p)
Fills the touchable zone for the drawable only with the the given Paint. |
boolean |
equals(java.lang.Object o)
|
EntityData |
getData()
Returns entity's data |
Drawable2D |
getDrawable2D()
|
Drawable3D |
getDrawable3D()
|
int |
getId()
Returns the entity's id |
Point3 |
getLocation()
Returns the entity's position |
float |
getRadius()
Returns the entity's radius |
java.lang.String |
getType()
Returns entity's type |
void |
init2D()
Initializes 2D appearance. |
void |
init3D()
Initializes 3D appearance. |
boolean |
isEnable()
|
boolean |
isFocusable()
Return whether this entity is focusable |
boolean |
isTouchable()
|
boolean |
isVisible()
|
void |
setDrawable2D(Drawable2D drawable2d)
|
void |
setDrawable3D(Drawable3D drawable3d)
|
void |
setEnable(boolean enable)
Sets if this entity is enabled to receive events |
void |
setFocusable(boolean focusable)
Sets if this entity is focusable |
void |
setRadius(float radius)
|
void |
setTouchable(boolean touchable)
Sets if this entity is touchable. |
void |
setVisible(boolean visible)
Sets if this entity is visible |
boolean |
touch(MotionEvent event)
Entity receives a touch event |
void |
update(long elapsed)
Updates the drawable |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorldEntity(EntityData data)
Method Detail |
---|
public void addCameraListener(CameraListener c)
c
- the camera listenerpublic void addTouchListener(TouchListener t)
t
- the touch listenerpublic void cameraEntered()
public void cameraExited()
public void draw(Canvas c)
Drawable2D
draw
in interface Drawable2D
draw
in interface Drawable3D
c
- the canvaspublic void draw(GL10 gl)
Drawable2D
draw
in interface Drawable2D
draw
in interface Drawable3D
gl
- the canvaspublic void drawTouchableArea(Canvas c, Paint p)
Drawable2D
drawTouchableArea
in interface Drawable2D
c
- the canvasp
- the paintpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public EntityData getData()
public Drawable2D getDrawable2D()
public Drawable3D getDrawable3D()
public int getId()
public Point3 getLocation()
public float getRadius()
public java.lang.String getType()
public void init2D()
public void init3D()
public boolean isEnable()
public boolean isFocusable()
public boolean isTouchable()
public boolean isVisible()
public void setDrawable2D(Drawable2D drawable2d)
drawable2d
- the drawable2D to setpublic void setDrawable3D(Drawable3D drawable3d)
drawable3d
- the drawable3D to setpublic void setEnable(boolean enable)
enable
- if this entity is enabled to receive eventspublic void setFocusable(boolean focusable)
focusable
- if this entity is focusablepublic void setRadius(float radius)
public void setTouchable(boolean touchable)
touchable
- If true, it'll receive touch eventspublic void setVisible(boolean visible)
visible
- public boolean touch(MotionEvent event)
action
- touch's action
public void update(long elapsed)
Drawable2D
update
in interface Drawable2D
update
in interface Drawable3D
elapsed
- elapsed time since last updated
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |