TileMapDefs2D.pkg 2.0 KB

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