AnimationSet2D.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // AnimationSet2D.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. /// Spriter animation set, it includes one or more animations, for more information please refer to http://www.esotericsoftware.com and http://www.brashmonkey.com/spriter.htm.
  21. /// </summary>
  22. public unsafe partial class AnimationSet2D : Resource
  23. {
  24. public AnimationSet2D (IntPtr handle) : base (handle)
  25. {
  26. }
  27. protected AnimationSet2D (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  28. {
  29. }
  30. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  31. internal static extern int AnimationSet2D_GetType (IntPtr handle);
  32. private StringHash UrhoGetType ()
  33. {
  34. Runtime.ValidateRefCounted (this);
  35. return new StringHash (AnimationSet2D_GetType (handle));
  36. }
  37. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  38. internal static extern IntPtr AnimationSet2D_GetTypeName (IntPtr handle);
  39. private string GetTypeName ()
  40. {
  41. Runtime.ValidateRefCounted (this);
  42. return Marshal.PtrToStringAnsi (AnimationSet2D_GetTypeName (handle));
  43. }
  44. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  45. internal static extern int AnimationSet2D_GetTypeStatic ();
  46. private static StringHash GetTypeStatic ()
  47. {
  48. Runtime.Validate (typeof(AnimationSet2D));
  49. return new StringHash (AnimationSet2D_GetTypeStatic ());
  50. }
  51. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  52. internal static extern IntPtr AnimationSet2D_GetTypeNameStatic ();
  53. private static string GetTypeNameStatic ()
  54. {
  55. Runtime.Validate (typeof(AnimationSet2D));
  56. return Marshal.PtrToStringAnsi (AnimationSet2D_GetTypeNameStatic ());
  57. }
  58. public AnimationSet2D () : this (Application.CurrentContext)
  59. {
  60. }
  61. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  62. internal static extern IntPtr AnimationSet2D_AnimationSet2D (IntPtr context);
  63. public AnimationSet2D (Context context) : base (UrhoObjectFlag.Empty)
  64. {
  65. Runtime.Validate (typeof(AnimationSet2D));
  66. handle = AnimationSet2D_AnimationSet2D ((object)context == null ? IntPtr.Zero : context.Handle);
  67. Runtime.RegisterObject (this);
  68. }
  69. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  70. internal static extern void AnimationSet2D_RegisterObject (IntPtr context);
  71. /// <summary>
  72. /// Register object factory.
  73. /// </summary>
  74. public static void RegisterObject (Context context)
  75. {
  76. Runtime.Validate (typeof(AnimationSet2D));
  77. AnimationSet2D_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  78. }
  79. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  80. internal static extern bool AnimationSet2D_BeginLoad_File (IntPtr handle, IntPtr source);
  81. /// <summary>
  82. /// Load resource from stream. May be called from a worker thread. Return true if successful.
  83. /// </summary>
  84. public override bool BeginLoad (File source)
  85. {
  86. Runtime.ValidateRefCounted (this);
  87. return AnimationSet2D_BeginLoad_File (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  88. }
  89. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  90. internal static extern bool AnimationSet2D_BeginLoad_MemoryBuffer (IntPtr handle, IntPtr source);
  91. /// <summary>
  92. /// Load resource from stream. May be called from a worker thread. Return true if successful.
  93. /// </summary>
  94. public override bool BeginLoad (MemoryBuffer source)
  95. {
  96. Runtime.ValidateRefCounted (this);
  97. return AnimationSet2D_BeginLoad_MemoryBuffer (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  98. }
  99. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  100. internal static extern bool AnimationSet2D_EndLoad (IntPtr handle);
  101. /// <summary>
  102. /// Finish resource loading. Always called from the main thread. Return true if successful.
  103. /// </summary>
  104. public override bool EndLoad ()
  105. {
  106. Runtime.ValidateRefCounted (this);
  107. return AnimationSet2D_EndLoad (handle);
  108. }
  109. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  110. internal static extern uint AnimationSet2D_GetNumAnimations (IntPtr handle);
  111. /// <summary>
  112. /// Get number of animations.
  113. /// </summary>
  114. private uint GetNumAnimations ()
  115. {
  116. Runtime.ValidateRefCounted (this);
  117. return AnimationSet2D_GetNumAnimations (handle);
  118. }
  119. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  120. internal static extern IntPtr AnimationSet2D_GetAnimation (IntPtr handle, uint index);
  121. /// <summary>
  122. /// Return animation name.
  123. /// </summary>
  124. public string GetAnimation (uint index)
  125. {
  126. Runtime.ValidateRefCounted (this);
  127. return Marshal.PtrToStringAnsi (AnimationSet2D_GetAnimation (handle, index));
  128. }
  129. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  130. internal static extern bool AnimationSet2D_HasAnimation (IntPtr handle, string animation);
  131. /// <summary>
  132. /// Check has animation.
  133. /// </summary>
  134. public bool HasAnimation (string animation)
  135. {
  136. Runtime.ValidateRefCounted (this);
  137. return AnimationSet2D_HasAnimation (handle, animation);
  138. }
  139. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  140. internal static extern IntPtr AnimationSet2D_GetSprite (IntPtr handle);
  141. /// <summary>
  142. /// Return sprite.
  143. /// </summary>
  144. private Sprite2D GetSprite ()
  145. {
  146. Runtime.ValidateRefCounted (this);
  147. return Runtime.LookupObject<Sprite2D> (AnimationSet2D_GetSprite (handle));
  148. }
  149. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  150. internal static extern IntPtr AnimationSet2D_GetSpriterFileSprite (IntPtr handle, int folderId, int fileId);
  151. /// <summary>
  152. /// Return spriter file sprite.
  153. /// </summary>
  154. public Sprite2D GetSpriterFileSprite (int folderId, int fileId)
  155. {
  156. Runtime.ValidateRefCounted (this);
  157. return Runtime.LookupObject<Sprite2D> (AnimationSet2D_GetSpriterFileSprite (handle, folderId, fileId));
  158. }
  159. public override StringHash Type {
  160. get {
  161. return UrhoGetType ();
  162. }
  163. }
  164. public override string TypeName {
  165. get {
  166. return GetTypeName ();
  167. }
  168. }
  169. public new static StringHash TypeStatic {
  170. get {
  171. return GetTypeStatic ();
  172. }
  173. }
  174. public new static string TypeNameStatic {
  175. get {
  176. return GetTypeNameStatic ();
  177. }
  178. }
  179. /// <summary>
  180. /// Get number of animations.
  181. /// </summary>
  182. public uint NumAnimations {
  183. get {
  184. return GetNumAnimations ();
  185. }
  186. }
  187. /// <summary>
  188. /// Return sprite.
  189. /// </summary>
  190. public Sprite2D Sprite {
  191. get {
  192. return GetSprite ();
  193. }
  194. }
  195. }
  196. }