SpriteTexture.generated.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Rendering
  7. * @{
  8. */
  9. /// <summary>
  10. /// Texture interface that encapsulates underlying texture which allows us to create a sprite texture atlas (for example
  11. /// multiple SpriteTexture%s referencing different parts of a single Texture).
  12. /// </summary>
  13. public partial class SpriteTexture : Resource
  14. {
  15. private SpriteTexture(bool __dummy0) { }
  16. protected SpriteTexture() { }
  17. /// <summary>Creates a new sprite texture that references the entire area of the provided texture.</summary>
  18. public SpriteTexture(Texture texture)
  19. {
  20. Internal_create(this, texture);
  21. }
  22. /// <summary>Creates a new sprite texture that references a sub-area of the provided texture.</summary>
  23. public SpriteTexture(Vector2 uvOffset, Vector2 uvScale, Texture texture)
  24. {
  25. Internal_create0(this, ref uvOffset, ref uvScale, texture);
  26. }
  27. /// <summary>Determines the internal texture that the sprite texture references.</summary>
  28. public Texture Texture
  29. {
  30. get { return Internal_getTexture(mCachedPtr); }
  31. set { Internal_setTexture(mCachedPtr, value); }
  32. }
  33. /// <summary>
  34. /// Determines the offset into the referenced texture where the sprite starts. The offset is in UV coordinates, in range
  35. /// [0, 1].
  36. /// </summary>
  37. public Vector2 Offset
  38. {
  39. get
  40. {
  41. Vector2 temp;
  42. Internal_getOffset(mCachedPtr, out temp);
  43. return temp;
  44. }
  45. set { Internal_setOffset(mCachedPtr, ref value); }
  46. }
  47. /// <summary>
  48. /// Determines the size of the sprite in the referenced texture. Size is in UV coordinates, range [0, 1].
  49. /// </summary>
  50. public Vector2 Scale
  51. {
  52. get
  53. {
  54. Vector2 temp;
  55. Internal_getScale(mCachedPtr, out temp);
  56. return temp;
  57. }
  58. set { Internal_setScale(mCachedPtr, ref value); }
  59. }
  60. /// <summary>Returns width of the sprite texture in pixels.</summary>
  61. public uint Width
  62. {
  63. get { return Internal_getWidth(mCachedPtr); }
  64. }
  65. /// <summary>Returns height of the sprite texture in pixels.</summary>
  66. public uint Height
  67. {
  68. get { return Internal_getHeight(mCachedPtr); }
  69. }
  70. [MethodImpl(MethodImplOptions.InternalCall)]
  71. private static extern void Internal_setTexture(IntPtr thisPtr, Texture texture);
  72. [MethodImpl(MethodImplOptions.InternalCall)]
  73. private static extern Texture Internal_getTexture(IntPtr thisPtr);
  74. [MethodImpl(MethodImplOptions.InternalCall)]
  75. private static extern void Internal_setOffset(IntPtr thisPtr, ref Vector2 offset);
  76. [MethodImpl(MethodImplOptions.InternalCall)]
  77. private static extern void Internal_getOffset(IntPtr thisPtr, out Vector2 __output);
  78. [MethodImpl(MethodImplOptions.InternalCall)]
  79. private static extern void Internal_setScale(IntPtr thisPtr, ref Vector2 scale);
  80. [MethodImpl(MethodImplOptions.InternalCall)]
  81. private static extern void Internal_getScale(IntPtr thisPtr, out Vector2 __output);
  82. [MethodImpl(MethodImplOptions.InternalCall)]
  83. private static extern uint Internal_getWidth(IntPtr thisPtr);
  84. [MethodImpl(MethodImplOptions.InternalCall)]
  85. private static extern uint Internal_getHeight(IntPtr thisPtr);
  86. [MethodImpl(MethodImplOptions.InternalCall)]
  87. private static extern void Internal_create(SpriteTexture managedInstance, Texture texture);
  88. [MethodImpl(MethodImplOptions.InternalCall)]
  89. private static extern void Internal_create0(SpriteTexture managedInstance, ref Vector2 uvOffset, ref Vector2 uvScale, Texture texture);
  90. }
  91. /** @} */
  92. }