LPCGame
A Simple 2d Game Engine
|
Allows for editing of a map. More...
#include <mapeditor.h>
Inherits Map.
Public Member Functions | |
void | GenerateBlank (int x, int y) |
void | Insert (int x, int y, std::string name) |
void | Remove (int x, int y) |
![]() | |
void | Draw (std::weak_ptr< Camera > cam) |
void | GenerateStressMap (Json::Value val) |
int | CalculateIndex (int x, int y, int w, int h) const |
std::set< int > | CalculateIndex (Recti area) const |
CollisionMap | GetCollisionMap (const Recti &target, int distance=2) |
Recti | Box () const |
Get the map's box. | |
void | LoadTileSet (std::shared_ptr< TileSet > ts) |
Sets the tileset. | |
std::string | File () const |
Get the map filename. | |
Json::Value | Save () |
void | Load (Json::Value val) |
void | Load (const std::string &file) |
Additional Inherited Members | |
![]() | |
std::vector< Tile > | mTiles |
Recti | mBox |
std::shared_ptr< TileSet > | mTileSet |
std::string | mFile |
Camera * | lastCamera |
std::set< int > | indices |
Allows for editing of a map.
Lets you edit the map by inserting or removing tiles
void MapEditor::GenerateBlank | ( | int | x, |
int | y | ||
) |
Generate a blank map that is x tiles wide and y tiles tall
x | The width of the map, in tiles |
y | The height of the map, in tiles |
void MapEditor::Insert | ( | int | x, |
int | y, | ||
std::string | name | ||
) |
Insert a tile at the tile located at some x, y point
x | The x coordinate to insert tile at |
y | The y coordinate to insert tile at |
tile | The tile to insert at the point |
void MapEditor::Remove | ( | int | x, |
int | y | ||
) |
Remove a tile at some point, really just performs Insert of the default tile
x | The x coordinate to clear |
y | The y coordinate to clear |