TileMapDefs2D.pkg 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. class Tile2D
  43. {
  44. int GetGid() const;
  45. Sprite2D* GetSprite() const;
  46. bool HasProperty(const String name) const;
  47. const String GetProperty(const String name) const;
  48. tolua_readonly tolua_property__get_set int gid;
  49. tolua_readonly tolua_property__get_set Sprite2D* sprite;
  50. };
  51. class TileMapObject2D
  52. {
  53. TileMapObjectType2D GetObjectType() const;
  54. const String GetName() const;
  55. const String GetType() const;
  56. const Vector2& GetPosition() const;
  57. const Vector2& GetSize() const;
  58. unsigned GetNumPoints() const;
  59. const Vector2& GetPoint(unsigned index) const;
  60. int GetTileGid() const;
  61. Sprite2D* GetTileSprite() const;
  62. bool HasProperty(const String name) const;
  63. const String GetProperty(const String name) const;
  64. tolua_readonly tolua_property__get_set TileMapObjectType2D objectType;
  65. tolua_readonly tolua_property__get_set String name;
  66. tolua_readonly tolua_property__get_set String type;
  67. tolua_readonly tolua_property__get_set Vector2 position;
  68. tolua_readonly tolua_property__get_set Vector2 size;
  69. tolua_readonly tolua_property__get_set unsigned numPoints;
  70. tolua_readonly tolua_property__get_set int tileGid;
  71. tolua_readonly tolua_property__get_set Sprite2D* tileSprite;
  72. };