Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 672 Bytes

entity-methods.md

File metadata and controls

51 lines (33 loc) · 672 Bytes

Entity methods

Get the position of an entity

Get x (left) position of entity:

entity.getX();

Get y (top) position of entity:

entity.getY();

Move an entity

Programmatically move an entity:

entity.translate(targetX, targetY);

Get the size of an entity

Get the width of an entity:

entity.getWidth();

Get the height of an entity:

entity.getHeight();

Get the bounding rectangle of an entity:

entity.getBoundingRectange();

Resize an entity

Programmatically resize an entity:

entity.resize(newWidth, newHeight);