Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
|
The base of all physic and drawable object. More...
#include <header.hpp>
Public Member Functions | |
bool | operator== (Object obj) |
Compare two objects (return true if these objects are in fact the same object). | |
luaObject | Clone () |
Create a clone of the object and return an handler to the clone. | |
luaObject | CloneToGroup (Group newParent) |
Create a clone of the object, change the parent and return an handler to the clone. | |
Vector2D | GetPosition () |
Get the object's position. | |
nil | SetPosition (Vector2D pos) |
Set the object's position. | |
number | GetRotation () |
Get the object's rotation. | |
nil | SetRotation (number angle) |
Set the object's rotation. | |
number | GetPositionX () |
Get the object's x position. | |
number | GetPositionY () |
Get the object's y position. | |
nil | SetPositionX (number pos) |
Set the object's x position. | |
nil | SetPositionY (number pos) |
Set the object's y position. | |
Vector2D | GetGlobalPosition () |
Get the object's global position (position from the top left corner of the screen) | |
nil | SetGlobalPosition (Vector2D pos) |
Set the object's global position (position from the top left corner of the screen) | |
number | GetGlobalRotation () |
Get the object's global rotation (rotation of all parents and the object) | |
nil | SetGlobalRotation (number rotation) |
Set the object's global rotation (rotation of all parents and the object) | |
nil | Rotate (number angle) |
Rotate the object. | |
nil | Move (Vector2D mvt) |
Move the object. | |
string | GetName () |
Get the object's name. | |
nil | SetName (string str) |
Set the object's name. | |
nil | SetSpeed (Vector2D speed) |
Set the object's speed. | |
Vector2D | GetSpeed () |
Get the object's speed. | |
nil | SetAngularVelocity (number speed) |
Set the object's angular velocity. | |
number | GetAngularVelocity () |
Get the object's angular velocity. | |
number | GetType () |
Get the object's type id. | |
long | GetUniqueId () |
Get an uniq identificator related to this object. | |
nil | ChangeParent (Group parent) |
Change the parent of the object. | |
nil | Destroy () |
Destroy the object. | |
luaObject | GetParent () |
Get the object's parent (can be a Group or a Screen) | |
nil | SetUserData (string id, luaObject data) |
Set user data. | |
luaObject | GetUserData (string id) |
Get user data. | |
bool | UserDataExists (string id) |
Return true if the user data exists, false otherwise. | |
ProtectedPtr< Screen > | GetParentScreen () |
Get the screen (main parent) of this object. | |
Public Attributes | |
Vector2D | position |
Access the object's position. | |
float | rotation |
Access the object's rotation. | |
float | x |
Access the object's x position. | |
float | y |
Access the object's y position. | |
Vector2D | globalPosition |
Access the object's global position (position from the top left corner of the screen) | |
Vector2D | rotation |
Access the object's global rotation (rotation of all parents and the object) | |
std::string | name |
Access the object's name. | |
float | speed |
Access the object's speed. | |
float | angularVelocity |
Access the object's angular velocity. |
The base of all physic and drawable object.
nil Object::ChangeParent | ( | Group | parent | ) |
Change the parent of the object.
luaObject Object::Clone | ( | ) |
Create a clone of the object and return an handler to the clone.
luaObject Object::CloneToGroup | ( | Group | newParent | ) |
Create a clone of the object, change the parent and return an handler to the clone.
nil Object::Destroy | ( | ) |
Destroy the object.
number Object::GetAngularVelocity | ( | ) |
Get the object's angular velocity.
Vector2D Object::GetGlobalPosition | ( | ) |
Get the object's global position (position from the top left corner of the screen)
number Object::GetGlobalRotation | ( | ) |
Get the object's global rotation (rotation of all parents and the object)
string Object::GetName | ( | ) |
Get the object's name.
ProtectedPtr<Screen> Object::GetParentScreen | ( | ) |
Get the screen (main parent) of this object.
Vector2D Object::GetPosition | ( | ) |
Get the object's position.
number Object::GetPositionX | ( | ) |
Get the object's x position.
number Object::GetPositionY | ( | ) |
Get the object's y position.
number Object::GetRotation | ( | ) |
Get the object's rotation.
Vector2D Object::GetSpeed | ( | ) |
Get the object's speed.
number Object::GetType | ( | ) |
Get the object's type id.
long Object::GetUniqueId | ( | ) |
Get an uniq identificator related to this object.
luaObject Object::GetUserData | ( | string | id | ) |
Get user data.
nil Object::Move | ( | Vector2D | mvt | ) |
Move the object.
bool Object::operator== | ( | Object | obj | ) |
Compare two objects (return true if these objects are in fact the same object).
nil Object::Rotate | ( | number | angle | ) |
Rotate the object.
nil Object::SetAngularVelocity | ( | number | speed | ) |
Set the object's angular velocity.
nil Object::SetGlobalPosition | ( | Vector2D | pos | ) |
Set the object's global position (position from the top left corner of the screen)
nil Object::SetGlobalRotation | ( | number | rotation | ) |
Set the object's global rotation (rotation of all parents and the object)
nil Object::SetName | ( | string | str | ) |
Set the object's name.
nil Object::SetPosition | ( | Vector2D | pos | ) |
Set the object's position.
nil Object::SetPositionX | ( | number | pos | ) |
Set the object's x position.
nil Object::SetPositionY | ( | number | pos | ) |
Set the object's y position.
nil Object::SetRotation | ( | number | angle | ) |
Set the object's rotation.
nil Object::SetSpeed | ( | Vector2D | speed | ) |
Set the object's speed.
nil Object::SetUserData | ( | string | id, |
luaObject | data | ||
) |
Set user data.
bool Object::UserDataExists | ( | string | id | ) |
Return true if the user data exists, false otherwise.
float Object::angularVelocity |
Access the object's angular velocity.
Access the object's global position (position from the top left corner of the screen)
std::string Object::name |
Access the object's name.
Access the object's position.
float Object::rotation |
Access the object's rotation.
Access the object's global rotation (rotation of all parents and the object)
float Object::speed |
Access the object's speed.
float Object::x |
Access the object's x position.
float Object::y |
Access the object's y position.