TileMapDefs2D.pkg 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. $#include "TileMapDefs2D.h"
  2. enum Orientation2D
  3. {
  4. O_ORTHOGONAL,
  5. O_ISOMETRIC,
  6. O_STAGGERED
  7. };
  8. struct TileMapInfo2D
  9. {
  10. Orientation2D orientation_ @ orientation;
  11. int width_ @ width;
  12. int height_ @ height;
  13. float tileWidth_ @ tileWidth;
  14. float tileHeight_ @ tileHeight;
  15. float GetMapWidth() const;
  16. float GetMapHeight() const;
  17. tolua_readonly tolua_property__get_set float mapWidth;
  18. tolua_readonly tolua_property__get_set float mapHeight;
  19. };
  20. enum TileMapLayerType2D
  21. {
  22. LT_TILE_LAYER,
  23. LT_OBJECT_GROUP,
  24. LT_IMAGE_LAYER,
  25. LT_INVALID
  26. };
  27. enum TileMapObjectType2D
  28. {
  29. OT_RECTANGLE,
  30. OT_ELLIPSE,
  31. OT_POLYGON,
  32. OT_POLYLINE,
  33. OT_TILE,
  34. OT_INVALID
  35. };
  36. class PropertySet2D
  37. {
  38. bool HasProperty(const String& name) const;
  39. const String& GetProperty(const String& name) const;
  40. };
  41. class Tile2D
  42. {
  43. int GetGid() const;
  44. Sprite2D* GetSprite() const;
  45. bool HasProperty(const String& name) const;
  46. const String& GetProperty(const String& name) const;
  47. tolua_readonly tolua_property__get_set int gid;
  48. tolua_readonly tolua_property__get_set Sprite2D* sprite;
  49. };
  50. class TileMapObject2D
  51. {
  52. TileMapObjectType2D GetObjectType() const;
  53. const String GetName() const;
  54. const String GetType() const;
  55. const Vector2& GetPosition() const;
  56. const Vector2& GetSize() const;
  57. unsigned GetNumPoints() const;
  58. const Vector2& GetPoint(unsigned index) const;
  59. int GetTileGid() const;
  60. Sprite2D* GetTileSprite() const;
  61. bool HasProperty(const String& name) const;
  62. const String& GetProperty(const String& name) const;
  63. tolua_readonly tolua_property__get_set TileMapObjectType2D objectType;
  64. tolua_readonly tolua_property__get_set String name;
  65. tolua_readonly tolua_property__get_set String type;
  66. tolua_readonly tolua_property__get_set Vector2 position;
  67. tolua_readonly tolua_property__get_set Vector2 size;
  68. tolua_readonly tolua_property__get_set unsigned numPoints;
  69. tolua_readonly tolua_property__get_set int tileGid;
  70. tolua_readonly tolua_property__get_set Sprite2D* tileSprite;
  71. };