更换为wpf
This commit is contained in:
24
Spine/SpineWrappers/Attachments/IAttachment.cs
Normal file
24
Spine/SpineWrappers/Attachments/IAttachment.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Spine.SpineWrappers.Attachments
|
||||
{
|
||||
public interface IAttachment
|
||||
{
|
||||
/// <summary>
|
||||
/// 附件的唯一名字
|
||||
/// </summary>
|
||||
public string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 计算世界顶点数组
|
||||
/// </summary>
|
||||
/// <param name="slot">装载的插槽</param>
|
||||
/// <param name="worldVertices">顶点缓冲数组, 如果大小不足会重分配到合适的大小, 实际长度需要通过返回值获取</param>
|
||||
/// <returns><paramref name="worldVertices"/> 的实际长度, 顶点数是长度除以 2</returns>
|
||||
public int ComputeWorldVertices(ISlot slot, ref float[] worldVertices);
|
||||
}
|
||||
}
|
||||
13
Spine/SpineWrappers/Attachments/IBoundingBoxAttachment.cs
Normal file
13
Spine/SpineWrappers/Attachments/IBoundingBoxAttachment.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Spine.SpineWrappers.Attachments
|
||||
{
|
||||
public interface IBoundingBoxAttachment : IAttachment
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
13
Spine/SpineWrappers/Attachments/IClippingAttachment.cs
Normal file
13
Spine/SpineWrappers/Attachments/IClippingAttachment.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Spine.SpineWrappers.Attachments
|
||||
{
|
||||
public interface IClippingAttachment : IAttachment
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
51
Spine/SpineWrappers/Attachments/IMeshAttachment.cs
Normal file
51
Spine/SpineWrappers/Attachments/IMeshAttachment.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Spine.SpineWrappers.Attachments
|
||||
{
|
||||
public interface IMeshAttachment : IAttachment
|
||||
{
|
||||
/// <summary>
|
||||
/// R
|
||||
/// </summary>
|
||||
public float R { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// G
|
||||
/// </summary>
|
||||
public float G { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// B
|
||||
/// </summary>
|
||||
public float B { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A
|
||||
/// </summary>
|
||||
public float A { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用于渲染的纹理对象
|
||||
/// </summary>
|
||||
public SFML.Graphics.Texture RendererObject { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 顶点纹理坐标, 每个坐标有 u 和 v 两个数, 有效长度和 <see cref="IAttachment.ComputeWorldVertices(ISlot, ref float[])"/> 返回值一致
|
||||
/// </summary>
|
||||
public float[] UVs { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 三角形索引顶点数组, 每 3 个为一组, 指向顶点的下标 (不是顶点坐标数组下标)
|
||||
/// </summary>
|
||||
public int[] Triangles { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 边缘顶点数组长度
|
||||
/// </summary>
|
||||
public int HullLength { get; }
|
||||
}
|
||||
}
|
||||
13
Spine/SpineWrappers/Attachments/IPathAttachment.cs
Normal file
13
Spine/SpineWrappers/Attachments/IPathAttachment.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Spine.SpineWrappers.Attachments
|
||||
{
|
||||
public interface IPathAttachment : IAttachment
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
13
Spine/SpineWrappers/Attachments/IPointAttachment.cs
Normal file
13
Spine/SpineWrappers/Attachments/IPointAttachment.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Spine.SpineWrappers.Attachments
|
||||
{
|
||||
public interface IPointAttachment : IAttachment
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
51
Spine/SpineWrappers/Attachments/IRegionAttachment.cs
Normal file
51
Spine/SpineWrappers/Attachments/IRegionAttachment.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Spine.SpineWrappers.Attachments
|
||||
{
|
||||
public interface IRegionAttachment : IAttachment
|
||||
{
|
||||
/// <summary>
|
||||
/// 总是将 Region 附件矩形区域切分成两个这样的三角形
|
||||
/// </summary>
|
||||
private static readonly int[] _trangles = [0, 1, 2, 2, 3, 0];
|
||||
|
||||
/// <summary>
|
||||
/// R
|
||||
/// </summary>
|
||||
public float R { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// G
|
||||
/// </summary>
|
||||
public float G { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// B
|
||||
/// </summary>
|
||||
public float B { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A
|
||||
/// </summary>
|
||||
public float A { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用于渲染的纹理对象
|
||||
/// </summary>
|
||||
public SFML.Graphics.Texture RendererObject { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 顶点纹理坐标, 每个坐标有 u 和 v 两个数, 有效长度和 <see cref="IAttachment.ComputeWorldVertices(ISlot, ref float[])"/> 返回值一致
|
||||
/// </summary>
|
||||
public float[] UVs { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 三角形索引顶点数组, 每 3 个为一组, 指向顶点的下标 (不是顶点坐标数组下标)
|
||||
/// </summary>
|
||||
public int[] Triangles => _trangles;
|
||||
}
|
||||
}
|
||||
51
Spine/SpineWrappers/Attachments/ISkinnedMeshAttachment.cs
Normal file
51
Spine/SpineWrappers/Attachments/ISkinnedMeshAttachment.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Spine.SpineWrappers.Attachments
|
||||
{
|
||||
public interface ISkinnedMeshAttachment : IAttachment
|
||||
{
|
||||
/// <summary>
|
||||
/// R
|
||||
/// </summary>
|
||||
public float R { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// G
|
||||
/// </summary>
|
||||
public float G { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// B
|
||||
/// </summary>
|
||||
public float B { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A
|
||||
/// </summary>
|
||||
public float A { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用于渲染的纹理对象
|
||||
/// </summary>
|
||||
public SFML.Graphics.Texture RendererObject { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 顶点纹理坐标, 每个坐标有 u 和 v 两个数, 有效长度和 <see cref="IAttachment.ComputeWorldVertices(ISlot, ref float[])"/> 返回值一致
|
||||
/// </summary>
|
||||
public float[] UVs { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 三角形索引顶点数组, 每 3 个为一组, 指向顶点的下标 (不是顶点坐标数组下标)
|
||||
/// </summary>
|
||||
public int[] Triangles { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 边缘顶点数组长度
|
||||
/// </summary>
|
||||
public int HullLength { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user