TileMapDefs2D.pkg 2.4 KB

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