AnimationSet2D.cs 7.0 KB

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