SpriteSheetGridAnimation.generated.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. /// Descriptor that describes a simple sprite sheet animation. The parent texture is split into a grid of <paramref
  11. /// name="numRows"/> x <paramref name="numColumns"/>, each representing one frame of the animation. Every frame is of
  12. /// equal size. Frames are sequentially evaluated starting from the top-most row, iterating over all columns in a row and
  13. /// then moving to next row, up to <paramref name="count"/> frames. Frames in rows/colums past <paramref name="count"/>.
  14. /// <paramref name="fps"/> frames are evaluated every second, allowing you to control animation speed.
  15. /// </summary>
  16. [StructLayout(LayoutKind.Sequential), SerializeObject]
  17. public partial struct SpriteSheetGridAnimation
  18. {
  19. /// <summary>Initializes the struct with default values.</summary>
  20. public static SpriteSheetGridAnimation Default()
  21. {
  22. SpriteSheetGridAnimation value = new SpriteSheetGridAnimation();
  23. value.numRows = 1;
  24. value.numColumns = 1;
  25. value.count = 1;
  26. value.fps = 8;
  27. return value;
  28. }
  29. public SpriteSheetGridAnimation(uint numRows, uint numColumns, uint count, uint fps)
  30. {
  31. this.numRows = numRows;
  32. this.numColumns = numColumns;
  33. this.count = count;
  34. this.fps = fps;
  35. }
  36. /// <summary>
  37. /// Number of rows to divide the parent's texture area. Determines height of the individual frame (depends on parent
  38. /// texture size).
  39. /// </summary>
  40. public uint numRows;
  41. /// <summary>
  42. /// Number of columns to divide the parent's texture area. Determines column of the individual frame (depends on parent
  43. /// texture size).
  44. /// </summary>
  45. public uint numColumns;
  46. /// <summary>
  47. /// Number of frames in the animation. Must be less or equal than <see cref="numRows"/> * <see cref="numColumns"/>.
  48. /// </summary>
  49. public uint count;
  50. /// <summary>How many frames to evaluate each second. Determines the animation speed.</summary>
  51. public uint fps;
  52. }
  53. /** @} */
  54. }