public abstract class EntityRts
extends com.b3dgs.lionengine.game.entity.EntityGame
implements com.b3dgs.lionengine.anim.Animator, com.b3dgs.lionengine.game.Tiled
Constructor and Description |
---|
EntityRts(com.b3dgs.lionengine.game.SetupSurfaceGame setup,
MapTileRts<?,?,?> map)
Create a new entity.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
com.b3dgs.lionengine.anim.Animation |
getAnimationCurrent()
Get the current playing animation.
|
com.b3dgs.lionengine.anim.AnimState |
getAnimState() |
int |
getDistance(int tx,
int ty,
int tw,
int th,
boolean fromCenter)
Get distance in tile between the area.
|
int |
getDistanceInTile(com.b3dgs.lionengine.game.Tiled tiled,
boolean fromCenter)
Get distance in tile between the specified tiled.
|
int |
getFov()
Get field of view value (in tile).
|
int |
getFrame() |
int |
getFrameAnim() |
int |
getHeightInTile() |
int |
getLayer()
Get current layer value.
|
int |
getLocationInTileX() |
int |
getLocationInTileY() |
int |
getOffsetX()
Get horizontal offset (used in case of rendering).
|
int |
getOffsetY()
Get vertical offset (used in case of rendering).
|
com.b3dgs.lionengine.game.Orientation |
getOrientation()
Get current orientation.
|
int |
getPlayerId()
Get the player owner id.
|
int |
getWidthInTile() |
boolean |
isActive()
Check if entity is active.
|
boolean |
isAlive()
Check if entity is alive.
|
boolean |
isLayerChanged()
Check if layer has be changed.
|
boolean |
isOver()
Check if entity is currently over a cursor (hit by a cursor).
|
boolean |
isSelectable()
Check if entity is selectable.
|
boolean |
isSelected()
Check if entity is currently selected (hit by a cursor selection).
|
boolean |
isVisible()
Check if entity is visible.
|
void |
play(com.b3dgs.lionengine.anim.Animation anim) |
void |
render(com.b3dgs.lionengine.Graphic g,
CameraRts camera)
Render entity on screen depending of the camera.
|
void |
setActive(boolean state)
Set active state (false to disable mouse over and selection).
|
void |
setAlive(boolean state)
Set alive state.
|
void |
setAnimSpeed(double speed) |
void |
setFov(int fov)
Set field of view value (in tile).
|
void |
setFrame(int frame) |
void |
setLayer(int layer)
Define a layer number, used for rendering priority.
|
void |
setLocation(int tx,
int ty)
Set location in tile.
|
void |
setOrientation(com.b3dgs.lionengine.game.Orientation orientation)
Set specific orientation.
|
void |
setOver(boolean state)
Set over state (used with cursor selection, to apply cursor over effect).
|
void |
setPlayerId(int id)
Set the player owner id.
|
void |
setSelectable(boolean state)
Set the selectable state.
|
void |
setSelection(boolean state)
Set selection state (used with cursor selection, to give an order).
|
void |
setVisible(boolean state)
Set visibility state.
|
abstract void |
stop()
Stop any action.
|
void |
stopAnimation() |
void |
update(double extrp) |
void |
updateAnimation(double extrp)
Deprecated.
already called in main loop. Has to be called only on specific cases.
|
collide, collide, getCollisionBounds, getCollisionData, getCollisionRay, getDistance, getHeight, getLocationIntX, getLocationIntY, getLocationOffsetX, getLocationOffsetY, getLocationOldX, getLocationOldY, getLocationX, getLocationY, getMass, getMirror, getMirrorCancel, getWeight, getWidth, invertAxisY, mirror, moveLocation, moveLocation, renderCollision, resetGravity, setCollision, setGravityMax, setLocation, setLocationOffset, setLocationX, setLocationY, setMass, setMirrorCancel, setSize, teleport, teleportX, teleportY, updateCollision, updateGravity, updateMirror
public EntityRts(com.b3dgs.lionengine.game.SetupSurfaceGame setup, MapTileRts<?,?,?> map)
<entity surface="sprite.png">
<frames horizontal="" vertical=""/>
<size width="" height=""/>
<offset x="" y=""/>
</entity>
setup
- The entity setup.map
- The map reference.public abstract void stop()
public void render(com.b3dgs.lionengine.Graphic g, CameraRts camera)
g
- The graphic output.camera
- The camera viewpoint.public void setLocation(int tx, int ty)
tx
- The horizontal tile location.ty
- The vertical tile location.public void setPlayerId(int id)
id
- The player owner id.public void setLayer(int layer)
HandlerEntityRts.LAYERS
. 0 is rendered firstly, last is rendered lastly.layer
- The layer number.public void setOrientation(com.b3dgs.lionengine.game.Orientation orientation)
orientation
- The new orientation.public void setFov(int fov)
fov
- The field of view.public void setSelection(boolean state)
state
- The state.public void setOver(boolean state)
state
- The state.public void setActive(boolean state)
state
- The active state.public void setVisible(boolean state)
state
- The visibility state.public void setAlive(boolean state)
state
- The alive state.public void setSelectable(boolean state)
state
- The selectable state.public int getDistance(int tx, int ty, int tw, int th, boolean fromCenter)
tx
- The tile x.ty
- The tile y.tw
- The width in tile.th
- The height in tile.fromCenter
- true
to get distance from center only, false
from the global area.public int getDistanceInTile(com.b3dgs.lionengine.game.Tiled tiled, boolean fromCenter)
tiled
- The tiled to check.fromCenter
- true
to get distance from center only, false
from the global area.public int getFov()
public int getPlayerId()
public com.b3dgs.lionengine.game.Orientation getOrientation()
public int getLayer()
public com.b3dgs.lionengine.anim.Animation getAnimationCurrent()
public int getOffsetX()
public int getOffsetY()
public boolean isSelected()
true
if selected, false
else.public boolean isOver()
true
if over, false
else.public boolean isActive()
true
if active, false
else.public boolean isVisible()
public boolean isAlive()
true
if alive, false
else.public boolean isSelectable()
true
if selectable, false
else.public boolean isLayerChanged()
public void update(double extrp)
update
in class com.b3dgs.lionengine.game.entity.EntityGame
public void destroy()
destroy
in class com.b3dgs.lionengine.game.ObjectGame
public int getLocationInTileX()
getLocationInTileX
in interface com.b3dgs.lionengine.game.Tiled
public int getLocationInTileY()
getLocationInTileY
in interface com.b3dgs.lionengine.game.Tiled
public int getWidthInTile()
getWidthInTile
in interface com.b3dgs.lionengine.game.Tiled
public int getHeightInTile()
getHeightInTile
in interface com.b3dgs.lionengine.game.Tiled
public void play(com.b3dgs.lionengine.anim.Animation anim)
play
in interface com.b3dgs.lionengine.anim.Animator
public void setAnimSpeed(double speed)
setAnimSpeed
in interface com.b3dgs.lionengine.anim.Animator
public void setFrame(int frame)
setFrame
in interface com.b3dgs.lionengine.anim.Animator
public int getFrame()
getFrame
in interface com.b3dgs.lionengine.anim.Animator
public int getFrameAnim()
getFrameAnim
in interface com.b3dgs.lionengine.anim.Animator
public com.b3dgs.lionengine.anim.AnimState getAnimState()
getAnimState
in interface com.b3dgs.lionengine.anim.Animator
public void stopAnimation()
stopAnimation
in interface com.b3dgs.lionengine.anim.Animator
@Deprecated public void updateAnimation(double extrp)
updateAnimation
in interface com.b3dgs.lionengine.anim.Animator