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) |
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 (it will be destroyed at the end of the frame) | |
Group | GetParent () |
Get the object's parent. | |
Object | Clone () |
Clone the object. | |
Object | CloneToGroup (Group newParent) |
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. | |
PhLine | CastIntoPhLine () |
Cast (convert) the object into its real type (you should know it). | |
PhRect | CastIntoPhRect () |
Cast (convert) the object into its real type (you should know it). | |
PhTriangle | CastIntoPhTriangle () |
Cast (convert) the object into its real type (you should know it). | |
PhCircle | CastIntoPhCircle () |
Cast (convert) the object into its real type (you should know it). | |
PhShape | CastIntoPhShape () |
Cast (convert) the object into its real type (you should know it). | |
Group | CastIntoGroup () |
Cast (convert) the object into its real type (you should know it). | |
ParticleSource | CastIntoParticleSource () |
Cast (convert) the object into its real type (you should know it). | |
Shape | CastIntoShape () |
Cast (convert) the object into its real type (you should know it). | |
Sprite | CastIntoSprite () |
Cast (convert) the object into its real type (you should know it). | |
Text | CastIntoText () |
Cast (convert) the object into its real type (you should know it). | |
PostFX | CastIntoPostFX () |
Cast (convert) the object into its real type (you should know it). | |
Screen | CastIntoScreen () |
Cast (convert) the object into its real type (you should know it). | |
ScreenRenderer | CastIntoScreenRenderer () |
Cast (convert) the object into its real type (you should know it). | |
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.
Group Object::CastIntoGroup | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
ParticleSource Object::CastIntoParticleSource | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
PhCircle Object::CastIntoPhCircle | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
PhLine Object::CastIntoPhLine | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
PhRect Object::CastIntoPhRect | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
PhShape Object::CastIntoPhShape | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
PhTriangle Object::CastIntoPhTriangle | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
PostFX Object::CastIntoPostFX | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
Screen Object::CastIntoScreen | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
ScreenRenderer Object::CastIntoScreenRenderer | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
Shape Object::CastIntoShape | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
Sprite Object::CastIntoSprite | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
Text Object::CastIntoText | ( | ) |
Cast (convert) the object into its real type (you should know it).
An error occures if you try to cast the object into a bad type.
nil Object::ChangeParent | ( | Group | parent | ) |
Change the parent of the object.
Object Object::Clone | ( | ) |
Clone the object.
Reimplemented in Group, ParticleSource, PhCircle, PhLine, PhRect, PhShape, PhTriangle, PostFX, Shape, Sprite, Text, and ScreenRenderer.
Reimplemented in Group, ParticleSource, PhCircle, PhLine, PhRect, PhShape, PhTriangle, PostFX, Shape, Sprite, Text, and ScreenRenderer.
nil Object::Destroy | ( | ) |
Destroy the object (it will be destroyed at the end of the frame)
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.
Group Object::GetParent | ( | ) |
Get the object's parent.
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 | ) |
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.