LPCGame
A Simple 2d Game Engine
|
A class for selecting which tile to place in the editor. More...
#include <tilebar.h>
Inherits Entity.
Public Member Functions | |
void | Draw (Camera *cam=nullptr) |
void | OnMouseDown () |
On mouse up event. | |
std::string | GetSelection () |
void | Load (Json::Value val) |
void | LoadTileSet (std::shared_ptr< TileSet > ts) |
virtual Json::Value | Save () const |
![]() | |
Entity (std::string file) | |
virtual void | Init (std::shared_ptr< Entity > self=nullptr) |
virtual void | Free () |
virtual void | Update () |
Update the game object. | |
virtual void | Move (float deltaT) |
virtual void | Draw (std::weak_ptr< Camera > camera) |
virtual void | OnMouseUp () |
On mouse up event. | |
virtual void | OnClick () |
virtual void | OnMouseEnter () |
On mouse enter. | |
virtual void | OnMouseExit () |
On mouse exit. | |
virtual void | CheckMouseOver (const Vector2f &pos) |
bool | GetMouseOver () const |
Return T/F is the mouse is over the object. | |
Physics * | GetPhysics () |
std::weak_ptr< Physics > | GetPhysicsWeakPtr () |
void | SetCollisionMap (CollisionMap map) |
Rectf | Box () const |
Get the object's box. | |
void | SetTag (std::string tag) |
Set the entity's tag. | |
std::string | Tag () const |
Get the entity's tag. | |
void | SetName (std::string name) |
std::string | Name () const |
void | Render (bool b) |
Set the Entity render flag. | |
bool | Render () const |
Check if the Entity should be drawn. | |
void | IsUiElement (bool b) |
Set the Entity "is ui element" flag. | |
bool | IsUiElement () const |
Check if the Entity is a ui element. | |
LuaScript * | Script () |
Get a pointer to the Entity's LuaScript. | |
virtual void | Save (const std::string &file) const |
virtual void | Load (const std::string &file, Json::Value overrides=Json::Value()) |
Additional Inherited Members | |
![]() | |
Image | mImage |
std::shared_ptr< Physics > | mPhysics |
Handle's the objects physics. | |
std::string | mTag |
A general tag for the entity. | |
std::string | mName |
The entity's name. | |
std::string | mConfigFile |
bool | mMouseOver |
For tracking mouse over and clicks. | |
bool | mClicked |
bool | mRender |
For tracking if the entity should be rendered, and if it's a ui element. | |
bool | mUiElement |
LuaScript | mScript |
The entity's lua script. | |
A class for selecting which tile to place in the editor.
A ui element for the editor that enable selection of desired tiles/objects/etc to be placed into the map while editingPlanning: Can probably make this class similar to how I did it previously
void TileBar::Draw | ( | Camera * | cam = nullptr | ) |
Draw the tilebar, apply an adjustment for the camera if one is desired
cam | The camera to adjust for |
std::string TileBar::GetSelection | ( | ) |
Get the selected tile type
|
virtual |
Load the tilebar properties from a Json::Value tilesPerRow - The amount of tiles in each row. spacer - The amount of space between edges in the tilebar. xOffset - The amount of offset in the X direction from the top left. yOffset - The amount of offset in the Y direction from the top left. tileWidth - The width of the tiles to be displayed in the tilebar. tileHeight - The height of the tiles to be displayed in the tilebar.
val | The Json::Value to load from |
Reimplemented from Entity.
|
inline |
Allows the tileset to be used in the tilebar
The | tileset as defined previously. |
|
virtual |
Save the tilebar data to a json value and return it
Reimplemented from Entity.