TileMap2D.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // TileMap2D.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho.Urho2D
  18. {
  19. /// <summary>
  20. /// Tile map component.
  21. /// </summary>
  22. public unsafe partial class TileMap2D : Component
  23. {
  24. unsafe partial void OnTileMap2DCreated ();
  25. [Preserve]
  26. public TileMap2D (IntPtr handle) : base (handle)
  27. {
  28. OnTileMap2DCreated ();
  29. }
  30. [Preserve]
  31. protected TileMap2D (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnTileMap2DCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int TileMap2D_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (TileMap2D_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr TileMap2D_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (TileMap2D_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int TileMap2D_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(TileMap2D));
  54. return new StringHash (TileMap2D_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr TileMap2D_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(TileMap2D));
  61. return Marshal.PtrToStringAnsi (TileMap2D_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public TileMap2D () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr TileMap2D_TileMap2D (IntPtr context);
  69. [Preserve]
  70. public TileMap2D (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(TileMap2D));
  73. handle = TileMap2D_TileMap2D ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnTileMap2DCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void TileMap2D_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(TileMap2D));
  85. TileMap2D_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void TileMap2D_DrawDebugGeometry (IntPtr handle, IntPtr debug, bool depthTest);
  89. /// <summary>
  90. /// Visualize the component as debug geometry.
  91. /// </summary>
  92. public override void DrawDebugGeometry (DebugRenderer debug, bool depthTest)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. TileMap2D_DrawDebugGeometry (handle, (object)debug == null ? IntPtr.Zero : debug.Handle, depthTest);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void TileMap2D_SetTmxFile (IntPtr handle, IntPtr tmxFile);
  99. /// <summary>
  100. /// Set tmx file.
  101. /// </summary>
  102. private void SetTmxFile (TmxFile2D tmxFile)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. TileMap2D_SetTmxFile (handle, (object)tmxFile == null ? IntPtr.Zero : tmxFile.Handle);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void TileMap2D_DrawDebugGeometry0 (IntPtr handle);
  109. /// <summary>
  110. /// Add debug geometry to the debug renderer.
  111. /// </summary>
  112. public void DrawDebugGeometry ()
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. TileMap2D_DrawDebugGeometry0 (handle);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern IntPtr TileMap2D_GetTmxFile (IntPtr handle);
  119. /// <summary>
  120. /// Return tmx file.
  121. /// </summary>
  122. private TmxFile2D GetTmxFile ()
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. return Runtime.LookupObject<TmxFile2D> (TileMap2D_GetTmxFile (handle));
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern Urho.Urho2D.TileMapInfo2D TileMap2D_GetInfo (IntPtr handle);
  129. /// <summary>
  130. /// Return information.
  131. /// </summary>
  132. private Urho.Urho2D.TileMapInfo2D GetInfo ()
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. return TileMap2D_GetInfo (handle);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern uint TileMap2D_GetNumLayers (IntPtr handle);
  139. /// <summary>
  140. /// Return number of layers.
  141. /// </summary>
  142. private uint GetNumLayers ()
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. return TileMap2D_GetNumLayers (handle);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern IntPtr TileMap2D_GetLayer (IntPtr handle, uint index);
  149. /// <summary>
  150. /// Return tile map layer at index.
  151. /// </summary>
  152. public TileMapLayer2D GetLayer (uint index)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. return Runtime.LookupObject<TileMapLayer2D> (TileMap2D_GetLayer (handle, index));
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern Vector2 TileMap2D_TileIndexToPosition (IntPtr handle, int x, int y);
  159. /// <summary>
  160. /// Convert tile index to position.
  161. /// </summary>
  162. public Vector2 TileIndexToPosition (int x, int y)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. return TileMap2D_TileIndexToPosition (handle, x, y);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern bool TileMap2D_PositionToTileIndex (IntPtr handle, ref int x, ref int y, ref Urho.Vector2 position);
  169. /// <summary>
  170. /// Convert position to tile index, if out of map return false.
  171. /// </summary>
  172. public bool PositionToTileIndex (ref int x, ref int y, Urho.Vector2 position)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. return TileMap2D_PositionToTileIndex (handle, ref x, ref y, ref position);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern ResourceRef TileMap2D_GetTmxFileAttr (IntPtr handle);
  179. /// <summary>
  180. /// Return tile map file attribute.
  181. /// </summary>
  182. private ResourceRef GetTmxFileAttr ()
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. return TileMap2D_GetTmxFileAttr (handle);
  186. }
  187. public override StringHash Type {
  188. get {
  189. return UrhoGetType ();
  190. }
  191. }
  192. public override string TypeName {
  193. get {
  194. return GetTypeName ();
  195. }
  196. }
  197. [Preserve]
  198. public new static StringHash TypeStatic {
  199. get {
  200. return GetTypeStatic ();
  201. }
  202. }
  203. public new static string TypeNameStatic {
  204. get {
  205. return GetTypeNameStatic ();
  206. }
  207. }
  208. /// <summary>
  209. /// Return tmx file.
  210. /// Or
  211. /// Set tmx file.
  212. /// </summary>
  213. public TmxFile2D TmxFile {
  214. get {
  215. return GetTmxFile ();
  216. }
  217. set {
  218. SetTmxFile (value);
  219. }
  220. }
  221. /// <summary>
  222. /// Return information.
  223. /// </summary>
  224. public Urho.Urho2D.TileMapInfo2D Info {
  225. get {
  226. return GetInfo ();
  227. }
  228. }
  229. /// <summary>
  230. /// Return number of layers.
  231. /// </summary>
  232. public uint NumLayers {
  233. get {
  234. return GetNumLayers ();
  235. }
  236. }
  237. /// <summary>
  238. /// Return tile map file attribute.
  239. /// </summary>
  240. public ResourceRef TmxFileAttr {
  241. get {
  242. return GetTmxFileAttr ();
  243. }
  244. }
  245. }
  246. }