[monogame] Created new MonoGame solution and projects as replacement for spine-xna. See #1949.
7
.gitignore
vendored
@ -155,3 +155,10 @@ spine-ts/spine-threejs/dist
|
||||
spine-libgdx/gradle
|
||||
spine-libgdx/gradlew
|
||||
spine-libgdx/gradlew.bat
|
||||
spine-monogame/packages
|
||||
spine-monogame/spine-monogame/bin
|
||||
spine-monogame/spine-monogame/obj
|
||||
spine-monogame/spine-monogame-example/Content/bin
|
||||
spine-monogame/spine-monogame-example/Content/obj
|
||||
spine-monogame/spine-monogame-example/bin
|
||||
spine-monogame/spine-monogame-example/obj
|
||||
|
||||
1
spine-monogame/.mgstats
Normal file
@ -0,0 +1 @@
|
||||
Source File,Dest File,Processor Type,Content Type,Source File Size,Dest File Size,Build Seconds
|
||||
@ -1,38 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "spine-monogame-example", "example\spine-monogame-example.csproj", "{0A7474EC-4DF9-40E7-B920-D1D1601F20A7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "spine-csharp", "..\spine-csharp\spine-csharp.csproj", "{94144E22-2431-4A8F-AC04-DEC22F7EDD8F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0A7474EC-4DF9-40E7-B920-D1D1601F20A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0A7474EC-4DF9-40E7-B920-D1D1601F20A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0A7474EC-4DF9-40E7-B920-D1D1601F20A7}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{0A7474EC-4DF9-40E7-B920-D1D1601F20A7}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{0A7474EC-4DF9-40E7-B920-D1D1601F20A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0A7474EC-4DF9-40E7-B920-D1D1601F20A7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0A7474EC-4DF9-40E7-B920-D1D1601F20A7}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{0A7474EC-4DF9-40E7-B920-D1D1601F20A7}.Release|x86.Build.0 = Release|Any CPU
|
||||
{94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{94144E22-2431-4A8F-AC04-DEC22F7EDD8F}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@ -1,146 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{0A7474EC-4DF9-40E7-B920-D1D1601F20A7}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>spine_monogame_example</RootNamespace>
|
||||
<AssemblyName>spine-monogame-example</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MonoGamePlatform>DesktopGL</MonoGamePlatform>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;LINUX</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
|
||||
<DefineConstants>TRACE;LINUX</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\spine-xna\src\ShapeRenderer.cs">
|
||||
<Link>spine-xna\ShapeRenderer.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-xna\src\SkeletonDebugRenderer.cs">
|
||||
<Link>spine-xna\SkeletonDebugRenderer.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-xna\src\VertexEffect.cs">
|
||||
<Link>spine-xna\VertexEffect.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-xna\src\MeshBatcher.cs">
|
||||
<Link>spine-xna\MeshBatcher.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-xna\src\SkeletonRenderer.cs">
|
||||
<Link>spine-xna\SkeletonRenderer.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-xna\src\Util.cs">
|
||||
<Link>spine-xna\Util.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-xna\src\XnaTextureLoader.cs">
|
||||
<Link>spine-xna\XnaTextureLoader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="ExampleGame.cs" />
|
||||
<Compile Include="ExampleProgram.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MonoGame.Framework">
|
||||
<HintPath>$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\MonoGame.Framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Icon.ico" />
|
||||
<EmbeddedResource Include="Icon.bmp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<MonoGameContentReference Include="Content\Content.mgcb">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</MonoGameContentReference>
|
||||
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x86\SDL2.dll">
|
||||
<Link>x86\SDL2.dll</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x64\SDL2.dll">
|
||||
<Link>x64\SDL2.dll</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x86\soft_oal.dll">
|
||||
<Link>x86\soft_oal.dll</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x64\soft_oal.dll">
|
||||
<Link>x64\soft_oal.dll</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x86\libSDL2-2.0.so.0">
|
||||
<Link>x86\libSDL2-2.0.so.0</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x64\libSDL2-2.0.so.0">
|
||||
<Link>x64\libSDL2-2.0.so.0</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x86\libopenal.so.1">
|
||||
<Link>x86\libopenal.so.1</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\x64\libopenal.so.1">
|
||||
<Link>x64\libopenal.so.1</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\MonoGame.Framework.dll.config">
|
||||
<Link>MonoGame.Framework.dll.config</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="app.manifest" />
|
||||
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\libopenal.1.dylib">
|
||||
<Link>x64\libopenal.1.dylib</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\DesktopGL\libSDL2-2.0.0.dylib">
|
||||
<Link>x64\libSDL2-2.0.0.dylib</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\spine-csharp\spine-csharp.csproj">
|
||||
<Project>{94144e22-2431-4a8f-ac04-dec22f7edd8f}</Project>
|
||||
<Name>spine-csharp</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
33
spine-monogame/spine-monogame-example/Content/Content.mgcb
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
#----------------------------- Global Properties ----------------------------#
|
||||
|
||||
/outputDir:bin/$(Platform)
|
||||
/intermediateDir:obj/$(Platform)
|
||||
/platform:DesktopGL
|
||||
/config:
|
||||
/profile:Reach
|
||||
/compress:False
|
||||
|
||||
#-------------------------------- References --------------------------------#
|
||||
|
||||
|
||||
#---------------------------------- Content ---------------------------------#
|
||||
|
||||
#begin SpineEffect.fx
|
||||
/importer:EffectImporter
|
||||
/processor:EffectProcessor
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:shaders\\SpineEffect.fx
|
||||
|
||||
#begin SpineEffectNormalMap.fx
|
||||
/importer:EffectImporter
|
||||
/processor:EffectProcessor
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:shaders\\SpineEffectNormalMap.fx
|
||||
|
||||
#begin SpineEffectOutline.fx
|
||||
/importer:EffectImporter
|
||||
/processor:EffectProcessor
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:shaders\\SpineEffectOutline.fx
|
||||
|
||||
@ -0,0 +1,125 @@
|
||||
#if OPENGL
|
||||
#define SV_POSITION POSITION
|
||||
#define VS_SHADERMODEL vs_3_0
|
||||
#define PS_SHADERMODEL ps_3_0
|
||||
#else
|
||||
#define VS_SHADERMODEL vs_4_0_level_9_1
|
||||
#define PS_SHADERMODEL ps_4_0_level_9_1
|
||||
#endif
|
||||
|
||||
float4x4 World;
|
||||
float4x4 View;
|
||||
float4x4 Projection;
|
||||
|
||||
// Light0 parameters.
|
||||
// Default values set below, change them via spineEffect.Parameters["Light0_Direction"] and similar.
|
||||
float3 Light0_Direction = float3(-0.5265408f, -0.5735765f, -0.6275069f);
|
||||
float3 Light0_Diffuse = float3(1, 1, 1);
|
||||
float3 Light0_Specular = float3(1, 1, 1);
|
||||
float Light0_SpecularExponent = 2.0; // also called "shininess", "specular hardness"
|
||||
|
||||
sampler TextureSampler : register(s0);
|
||||
sampler NormalmapSampler : register(s1);
|
||||
|
||||
// TODO: add effect parameters here.
|
||||
|
||||
float NormalmapIntensity = 1;
|
||||
|
||||
float3 GetNormal(sampler normalmapSampler, float2 uv, float3 worldPos, float3 vertexNormal)
|
||||
{
|
||||
// Reconstruct tangent space TBN matrix
|
||||
float3 pos_dx = ddx(worldPos);
|
||||
float3 pos_dy = ddy(worldPos);
|
||||
float3 tex_dx = float3(ddx(uv), 0.0);
|
||||
float3 tex_dy = float3(ddy(uv), 0.0);
|
||||
float divisor = (tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y);
|
||||
float3 t = (tex_dy.y * pos_dx - tex_dx.y * pos_dy) / divisor;
|
||||
|
||||
float divisorBinormal = (tex_dy.y * tex_dx.x - tex_dx.y * tex_dy.x);
|
||||
float3 b = (tex_dx.x * pos_dy - tex_dy.x * pos_dx) / divisorBinormal;
|
||||
|
||||
t = normalize(t - vertexNormal * dot(vertexNormal, t));
|
||||
b = normalize(b - vertexNormal * dot(vertexNormal, b));
|
||||
float3x3 tbn = float3x3(t, b, vertexNormal);
|
||||
|
||||
float3 n = 2.0 * tex2D(normalmapSampler, uv).rgb - 1.0;
|
||||
#ifdef INVERT_NORMALMAP_Y
|
||||
n.y = -n.y;
|
||||
#endif
|
||||
n = normalize(mul(n * float3(NormalmapIntensity, NormalmapIntensity, 1.0), tbn));
|
||||
return n;
|
||||
}
|
||||
|
||||
void GetLightContributionBlinnPhong(inout float3 diffuseResult, inout float3 specularResult,
|
||||
float3 lightDirection, float3 lightDiffuse, float3 lightSpecular, float specularExponent, float3 normal, float3 viewDirection)
|
||||
{
|
||||
diffuseResult += lightDiffuse * max(0.0, dot(normal, -lightDirection));
|
||||
half3 halfVector = normalize(-lightDirection + viewDirection);
|
||||
float nDotH = max(0, dot(normal, halfVector));
|
||||
specularExponent = max(0.00001, specularExponent); // prevent fx compiler error at pow() below
|
||||
specularResult += lightSpecular * pow(nDotH, specularExponent);
|
||||
}
|
||||
|
||||
struct VertexShaderInput
|
||||
{
|
||||
float4 Position : POSITION0;
|
||||
float4 Color : COLOR0;
|
||||
float4 TextureCoordinate : TEXCOORD0;
|
||||
float4 Color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VertexShaderOutput
|
||||
{
|
||||
float4 Position : POSITION0;
|
||||
float4 Color : COLOR0;
|
||||
float4 TextureCoordinate : TEXCOORD0;
|
||||
float4 Color2 : COLOR1;
|
||||
float3 WorldNormal : TEXCOORD1;
|
||||
float4 WorldPosition : TEXCOORD2; // for tangent reconstruction
|
||||
};
|
||||
|
||||
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
|
||||
{
|
||||
VertexShaderOutput output;
|
||||
|
||||
float4 worldPosition = mul(input.Position, World);
|
||||
float4 viewPosition = mul(worldPosition, View);
|
||||
output.Position = mul(viewPosition, Projection);
|
||||
output.TextureCoordinate = input.TextureCoordinate;
|
||||
output.Color = input.Color;
|
||||
output.Color2 = input.Color2;
|
||||
|
||||
output.WorldNormal = mul(transpose(View), float4(0, 0, 1, 0)).xyz;
|
||||
output.WorldPosition = worldPosition;
|
||||
return output;
|
||||
}
|
||||
|
||||
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
|
||||
{
|
||||
float4 texColor = tex2D(TextureSampler, input.TextureCoordinate);
|
||||
float3 normal = GetNormal(NormalmapSampler, input.TextureCoordinate, input.WorldPosition, input.WorldNormal);
|
||||
float3 viewDirection = -input.WorldNormal;
|
||||
|
||||
float alpha = texColor.a * input.Color.a;
|
||||
float4 output;
|
||||
output.a = alpha;
|
||||
output.rgb = ((texColor.a - 1.0) * input.Color2.a + 1.0 - texColor.rgb) * input.Color2.rgb + texColor.rgb * input.Color.rgb;
|
||||
|
||||
float3 diffuseLight = float3(0, 0, 0);
|
||||
float3 specularLight = float3(0, 0, 0);
|
||||
GetLightContributionBlinnPhong(diffuseLight, specularLight,
|
||||
Light0_Direction, Light0_Diffuse, Light0_Specular, Light0_SpecularExponent, normal, viewDirection);
|
||||
output.rgb = diffuseLight * output.rgb + specularLight;
|
||||
return output;
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass Pass1
|
||||
{
|
||||
// TODO: set renderstates here.
|
||||
|
||||
VertexShader = compile vs_3_0 VertexShaderFunction();
|
||||
PixelShader = compile ps_3_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,123 @@
|
||||
#if OPENGL
|
||||
#define SV_POSITION POSITION
|
||||
#define VS_SHADERMODEL vs_3_0
|
||||
#define PS_SHADERMODEL ps_3_0
|
||||
#else
|
||||
#define VS_SHADERMODEL vs_4_0_level_9_1
|
||||
#define PS_SHADERMODEL ps_4_0_level_9_1
|
||||
#endif
|
||||
|
||||
|
||||
float4x4 World;
|
||||
float4x4 View;
|
||||
float4x4 Projection;
|
||||
|
||||
sampler TextureSampler : register(s0);
|
||||
|
||||
float _OutlineWidth = 3;
|
||||
float4 _OutlineColor = float4(1, 1, 0, 1);
|
||||
float _ThresholdEnd = 0.25;
|
||||
float _OutlineSmoothness = 1.0;
|
||||
float _OutlineMipLevel = 0;
|
||||
|
||||
// TODO: add effect parameters here.
|
||||
|
||||
struct VertexShaderInput
|
||||
{
|
||||
float4 Position : POSITION0;
|
||||
float4 Color : COLOR0;
|
||||
float4 TextureCoordinate : TEXCOORD0;
|
||||
float4 Color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VertexShaderOutput
|
||||
{
|
||||
float4 Position : POSITION0;
|
||||
float4 Color : COLOR0;
|
||||
float4 TextureCoordinate : TEXCOORD0;
|
||||
float4 Color2 : COLOR1;
|
||||
};
|
||||
|
||||
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
|
||||
{
|
||||
VertexShaderOutput output;
|
||||
|
||||
float4 worldPosition = mul(input.Position, World);
|
||||
float4 viewPosition = mul(worldPosition, View);
|
||||
output.Position = mul(viewPosition, Projection);
|
||||
output.TextureCoordinate = input.TextureCoordinate;
|
||||
output.Color = input.Color;
|
||||
output.Color2 = input.Color2;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
|
||||
{
|
||||
float4 texColor = tex2D(TextureSampler, input.TextureCoordinate);
|
||||
float alpha = texColor.a * input.Color.a;
|
||||
float4 output;
|
||||
output.a = alpha;
|
||||
output.rgb = ((texColor.a - 1.0) * input.Color2.a + 1.0 - texColor.rgb) * input.Color2.rgb + texColor.rgb * input.Color.rgb;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
// Outline pass
|
||||
#define _USE8NEIGHBOURHOOD_ON
|
||||
|
||||
float4 PixelShaderFunctionOutline(VertexShaderOutput i) : COLOR0
|
||||
{
|
||||
float4 texColor = float4(0,0,0,0);
|
||||
|
||||
float uvDeltaPerPixel = max(ddx(i.TextureCoordinate), ddy(i.TextureCoordinate));
|
||||
float outlineWidthCompensated = _OutlineWidth * uvDeltaPerPixel;
|
||||
float xOffset = outlineWidthCompensated;
|
||||
float yOffset = outlineWidthCompensated;
|
||||
float xOffsetDiagonal = outlineWidthCompensated * 0.7;
|
||||
float yOffsetDiagonal = outlineWidthCompensated * 0.7;
|
||||
|
||||
float pixelCenter = tex2D(TextureSampler, i.TextureCoordinate).a;
|
||||
|
||||
float4 uvCenterWithLod = float4(i.TextureCoordinate.xy, 0, _OutlineMipLevel);
|
||||
float pixelTop = tex2Dlod(TextureSampler, uvCenterWithLod + float4(0, yOffset, 0, 0)).a;
|
||||
float pixelBottom = tex2Dlod(TextureSampler, uvCenterWithLod + float4(0, -yOffset, 0, 0)).a;
|
||||
float pixelLeft = tex2Dlod(TextureSampler, uvCenterWithLod + float4(-xOffset, 0, 0, 0)).a;
|
||||
float pixelRight = tex2Dlod(TextureSampler, uvCenterWithLod + float4(xOffset, 0, 0, 0)).a;
|
||||
#ifdef _USE8NEIGHBOURHOOD_ON
|
||||
float numSamples = 8;
|
||||
float pixelTopLeft = tex2Dlod(TextureSampler, uvCenterWithLod + float4(-xOffsetDiagonal, yOffsetDiagonal, 0, 0)).a;
|
||||
float pixelTopRight = tex2Dlod(TextureSampler, uvCenterWithLod + float4(xOffsetDiagonal, yOffsetDiagonal, 0, 0)).a;
|
||||
float pixelBottomLeft = tex2Dlod(TextureSampler, uvCenterWithLod + float4(-xOffsetDiagonal, -yOffsetDiagonal, 0, 0)).a;
|
||||
float pixelBottomRight = tex2Dlod(TextureSampler, uvCenterWithLod + float4(xOffsetDiagonal, -yOffsetDiagonal, 0, 0)).a;
|
||||
float average = (pixelTop + pixelBottom + pixelLeft + pixelRight +
|
||||
pixelTopLeft + pixelTopRight + pixelBottomLeft + pixelBottomRight)
|
||||
* i.Color.a / numSamples;
|
||||
#else // 4 neighbourhood
|
||||
float numSamples = 1;
|
||||
float average = (pixelTop + pixelBottom + pixelLeft + pixelRight) * i.Color.a / numSamples;
|
||||
#endif
|
||||
|
||||
float thresholdStart = _ThresholdEnd * (1.0 - _OutlineSmoothness);
|
||||
float outlineAlpha = saturate((average - thresholdStart) / (_ThresholdEnd - thresholdStart)) - pixelCenter;
|
||||
texColor.rgba = lerp(texColor, _OutlineColor, outlineAlpha);
|
||||
return texColor;
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass OutlinePass
|
||||
{
|
||||
// TODO: set renderstates here.
|
||||
|
||||
VertexShader = compile vs_3_0 VertexShaderFunction();
|
||||
PixelShader = compile ps_3_0 PixelShaderFunctionOutline();
|
||||
}
|
||||
pass Pass2
|
||||
{
|
||||
// TODO: set renderstates here.
|
||||
|
||||
VertexShader = compile vs_2_0 VertexShaderFunction();
|
||||
PixelShader = compile ps_2_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
@ -119,7 +119,7 @@ namespace Spine {
|
||||
public TankScreen (Example game) : base(game) {
|
||||
// Instantiate and configure the two color tinting effect and
|
||||
// assign it to the skeleton renderer
|
||||
var twoColorTintEffect = game.Content.Load<Effect>("Content\\SpineEffect");
|
||||
var twoColorTintEffect = game.Content.Load<Effect>("Content\\shaders\\SpineEffect");
|
||||
twoColorTintEffect.Parameters["World"].SetValue(Matrix.Identity);
|
||||
twoColorTintEffect.Parameters["View"].SetValue(Matrix.CreateLookAt(new Vector3(0.0f, 0.0f, 1.0f), Vector3.Zero, Vector3.Up));
|
||||
skeletonRenderer.Effect = twoColorTintEffect;
|
||||
|
Before Width: | Height: | Size: 256 KiB After Width: | Height: | Size: 256 KiB |
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 144 KiB |
@ -36,6 +36,7 @@
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
|
||||
259
spine-monogame/spine-monogame-example/data/coin-pro.json
Normal file
@ -0,0 +1,259 @@
|
||||
{
|
||||
"skeleton": {
|
||||
"hash": "5q2VQysgSd0",
|
||||
"spine": "4.1.04-beta",
|
||||
"x": -152.5,
|
||||
"y": -151,
|
||||
"width": 305,
|
||||
"height": 302,
|
||||
"images": "./images/",
|
||||
"audio": ""
|
||||
},
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "coin-front", "parent": "root" },
|
||||
{ "name": "clipping", "parent": "coin-front" },
|
||||
{ "name": "coin-sides", "parent": "root" },
|
||||
{ "name": "coin-side-round", "parent": "coin-sides" },
|
||||
{ "name": "coin-side-straight", "parent": "coin-sides" },
|
||||
{ "name": "shine", "parent": "root", "x": 243.14 }
|
||||
],
|
||||
"slots": [
|
||||
{ "name": "coin-side", "bone": "coin-side-straight", "color": "ffdb2fff", "attachment": "coin-side-straight" },
|
||||
{ "name": "coin-side-round", "bone": "coin-side-round", "color": "ffdb2fff", "attachment": "coin-side-round" },
|
||||
{ "name": "coin-front-texture", "bone": "coin-front", "color": "868686ff", "attachment": "coin-front-logo" },
|
||||
{ "name": "coin-front-shine", "bone": "coin-front", "color": "888888ff", "dark": "000000", "attachment": "coin-front-shine-logo", "blend": "additive" },
|
||||
{ "name": "clipping", "bone": "clipping", "attachment": "clipping" },
|
||||
{ "name": "shine", "bone": "shine", "color": "ffffff60", "attachment": "shine", "blend": "additive" }
|
||||
],
|
||||
"skins": [
|
||||
{
|
||||
"name": "default",
|
||||
"attachments": {
|
||||
"clipping": {
|
||||
"clipping": {
|
||||
"type": "clipping",
|
||||
"end": "clipping",
|
||||
"vertexCount": 39,
|
||||
"vertices": [ 0.1, 140.26, -26.4, 138.14, -50.51, 131.25, -75.42, 119.06, -98.21, 101.04, -115.44, 82.22, -127.63, 62.08, -136.11, 39.03, -140.08, 19.68, -141.41, -0.19, -140.08, -22.98, -134.78, -45.5, -125.24, -66.44, -113.32, -84.19, -98.21, -101.95, -80.46, -116.52, -61.38, -127.39, -38.92, -134.81, -18.22, -139.27, -0.14, -140.58, 24.23, -138.48, 45.45, -132.46, 67.98, -122.5, 86.58, -110.19, 102.56, -95.25, 115.4, -78.75, 125.36, -61.72, 134, -42.33, 138.46, -22.15, 139.24, -0.15, 138.46, 20.29, 133.48, 39.94, 127.19, 58.54, 117.5, 76.1, 104.4, 92.86, 88.42, 108.32, 69.03, 121.42, 50.43, 130.85, 26.32, 137.4 ],
|
||||
"color": "ce3a3aff"
|
||||
}
|
||||
},
|
||||
"coin-front-shine": {
|
||||
"coin-front-shine-logo": { "width": 282, "height": 282 },
|
||||
"coin-front-shine-spineboy": { "width": 282, "height": 282 }
|
||||
},
|
||||
"coin-front-texture": {
|
||||
"coin-front-logo": { "width": 305, "height": 302 },
|
||||
"coin-front-spineboy": { "width": 305, "height": 302 }
|
||||
},
|
||||
"coin-side": {
|
||||
"coin-side-straight": { "x": 0.5, "width": 17, "height": 282 }
|
||||
},
|
||||
"coin-side-round": {
|
||||
"coin-side-round": { "x": -69.43, "width": 144, "height": 282 }
|
||||
},
|
||||
"shine": {
|
||||
"shine": { "y": 0.5, "scaleX": 1.6004, "scaleY": 1.6004, "width": 72, "height": 245 }
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"animations": {
|
||||
"animation": {
|
||||
"slots": {
|
||||
"coin-front-shine": {
|
||||
"rgba2": [
|
||||
{ "light": "7d7d7dff", "dark": "000000" },
|
||||
{ "time": 0.2667, "light": "000000ff", "dark": "7e7e7e" },
|
||||
{ "time": 0.664, "light": "000000ff", "dark": "000000" },
|
||||
{ "time": 1.0333, "light": "7f7f7fff", "dark": "000000" },
|
||||
{ "time": 1.3333, "light": "404040ff", "dark": "000000" },
|
||||
{ "time": 1.6, "light": "000000ff", "dark": "7e7e7e" },
|
||||
{ "time": 2.0022, "light": "000000ff", "dark": "000000" },
|
||||
{ "time": 2.4, "light": "7f7f7fff", "dark": "000000" },
|
||||
{ "time": 2.6667, "light": "7d7d7dff", "dark": "000000" }
|
||||
],
|
||||
"attachment": [
|
||||
{ "time": 0.6667, "name": "coin-front-shine-spineboy" },
|
||||
{ "time": 2, "name": "coin-front-shine-logo" }
|
||||
]
|
||||
},
|
||||
"coin-front-texture": {
|
||||
"rgba": [
|
||||
{ "color": "858585ff" },
|
||||
{ "time": 0.4, "color": "ffffffff" },
|
||||
{
|
||||
"time": 0.6696,
|
||||
"color": "858585ff",
|
||||
"curve": [ 0.725, 0.59, 0.892, 1, 0.725, 0.59, 0.892, 1, 0.725, 0.59, 0.892, 1, 0.725, 1, 0.892, 1 ]
|
||||
},
|
||||
{ "time": 0.9667, "color": "ffffffff" },
|
||||
{ "time": 1.3318, "color": "858585ff", "curve": "stepped" },
|
||||
{ "time": 1.3333, "color": "858585ff" },
|
||||
{ "time": 1.7333, "color": "ffffffff" },
|
||||
{ "time": 1.9982, "color": "858585ff", "curve": "stepped" },
|
||||
{ "time": 2.0022, "color": "858585ff" },
|
||||
{ "time": 2.3, "color": "ffffffff" },
|
||||
{ "time": 2.6667, "color": "858585ff" }
|
||||
],
|
||||
"attachment": [
|
||||
{ "time": 0.6667, "name": "coin-front-spineboy" },
|
||||
{ "time": 2, "name": "coin-front-logo" }
|
||||
]
|
||||
}
|
||||
},
|
||||
"bones": {
|
||||
"coin-front": {
|
||||
"translate": [
|
||||
{},
|
||||
{ "time": 0.664, "x": 8.3, "curve": "stepped" },
|
||||
{
|
||||
"time": 0.6696,
|
||||
"x": -8.3,
|
||||
"curve": [ 0.794, -7.08, 1.167, 0, 0.794, 0, 1.167, 0 ]
|
||||
},
|
||||
{ "time": 1.3333 },
|
||||
{ "time": 1.9982, "x": 8.3, "curve": "stepped" },
|
||||
{ "time": 2.0022, "x": -8.3 },
|
||||
{ "time": 2.6667 }
|
||||
],
|
||||
"scale": [
|
||||
{
|
||||
"curve": [ 0.164, 1, 0.484, 0.091, 0.164, 1, 0.484, 1 ]
|
||||
},
|
||||
{ "time": 0.664, "x": 0, "curve": "stepped" },
|
||||
{
|
||||
"time": 0.6696,
|
||||
"x": 0.003,
|
||||
"curve": [ 0.786, 0.153, 1.167, 1, 0.786, 1, 1.167, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 1.3333,
|
||||
"curve": [ 1.442, 0.992, 1.858, 0.098, 1.442, 1, 1.858, 1 ]
|
||||
},
|
||||
{ "time": 1.9982, "x": 0.003, "curve": "stepped" },
|
||||
{
|
||||
"time": 2.0022,
|
||||
"x": 0.003,
|
||||
"curve": [ 2.123, 0.151, 2.501, 1, 2.123, 1, 2.501, 1 ]
|
||||
},
|
||||
{ "time": 2.6667 }
|
||||
]
|
||||
},
|
||||
"coin-side-round": {
|
||||
"translate": [
|
||||
{},
|
||||
{ "time": 0.664, "x": -6.75, "curve": "stepped" },
|
||||
{
|
||||
"time": 0.6696,
|
||||
"x": 7.03,
|
||||
"curve": [ 0.794, 5.99, 1.167, 0, 0.794, 0, 1.167, 0 ]
|
||||
},
|
||||
{ "time": 1.3333 },
|
||||
{ "time": 1.9982, "x": -6.75, "curve": "stepped" },
|
||||
{ "time": 2.0022, "x": 7.03 },
|
||||
{ "time": 2.6667 }
|
||||
],
|
||||
"scale": [
|
||||
{
|
||||
"curve": [ 0.085, 1, 0.207, 0.789, 0.085, 1, 0.207, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 0.3333,
|
||||
"x": 0.555,
|
||||
"curve": [ 0.449, 0.347, 0.567, 0.122, 0.449, 1, 0.567, 1 ]
|
||||
},
|
||||
{ "time": 0.664, "x": 0.014, "curve": "stepped" },
|
||||
{
|
||||
"time": 0.6696,
|
||||
"x": -0.028,
|
||||
"curve": [ 0.723, -0.126, 0.865, -0.367, 0.723, 1, 0.865, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 1,
|
||||
"x": -0.609,
|
||||
"curve": [ 1.053, -0.778, 1.29, -0.997, 1.053, 1, 1.29, 1 ]
|
||||
},
|
||||
{ "time": 1.3318, "x": -1, "curve": "stepped" },
|
||||
{
|
||||
"time": 1.3333,
|
||||
"curve": [ 1.384, 0.997, 1.439, 0.94, 1.384, 1, 1.439, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 1.5,
|
||||
"x": 0.852,
|
||||
"curve": [ 1.564, 0.748, 1.703, 0.509, 1.564, 1, 1.703, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 1.8,
|
||||
"x": 0.315,
|
||||
"curve": [ 1.873, 0.13, 1.987, 0.015, 1.873, 1, 1.987, 1 ]
|
||||
},
|
||||
{ "time": 1.9982, "x": 0.014, "curve": "stepped" },
|
||||
{
|
||||
"time": 2.0022,
|
||||
"x": -0.028,
|
||||
"curve": [ 2.039, -0.072, 2.123, -0.239, 2.039, 1, 2.123, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 2.2018,
|
||||
"x": -0.365,
|
||||
"curve": [ 2.269, -0.513, 2.337, -0.635, 2.269, 1, 2.337, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 2.4,
|
||||
"x": -0.731,
|
||||
"curve": [ 2.503, -0.871, 2.596, -0.961, 2.503, 1, 2.596, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 2.6592,
|
||||
"x": -1,
|
||||
"curve": [ 2.661, -1, 2.665, 1, 2.661, 1, 2.665, 1 ]
|
||||
},
|
||||
{ "time": 2.6667 }
|
||||
]
|
||||
},
|
||||
"shine": {
|
||||
"translate": [
|
||||
{
|
||||
"curve": [ 0.167, 0, 0.5, -473.39, 0.167, 0, 0.5, 0 ]
|
||||
},
|
||||
{
|
||||
"time": 0.6667,
|
||||
"x": -473.39,
|
||||
"curve": [ 0.833, -473.39, 1.167, -33.16, 0.833, 0, 1.167, 0 ]
|
||||
},
|
||||
{
|
||||
"time": 1.3333,
|
||||
"x": -33.16,
|
||||
"curve": [ 1.5, -33.16, 1.833, -473.39, 1.5, 0, 1.833, 0 ]
|
||||
},
|
||||
{
|
||||
"time": 2,
|
||||
"x": -473.39,
|
||||
"curve": [ 2.167, -473.39, 2.5, 0, 2.167, 0, 2.5, 0 ]
|
||||
},
|
||||
{ "time": 2.6667 }
|
||||
]
|
||||
}
|
||||
},
|
||||
"drawOrder": [
|
||||
{
|
||||
"time": 0.6667,
|
||||
"offsets": [
|
||||
{ "slot": "coin-side", "offset": 2 }
|
||||
]
|
||||
},
|
||||
{ "time": 0.6696 },
|
||||
{
|
||||
"time": 1.9982,
|
||||
"offsets": [
|
||||
{ "slot": "coin-side", "offset": 2 }
|
||||
]
|
||||
},
|
||||
{ "time": 2.0022 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
spine-monogame/spine-monogame-example/data/coin-pro.skel
Normal file
18
spine-monogame/spine-monogame-example/data/coin.atlas
Normal file
@ -0,0 +1,18 @@
|
||||
coin.png
|
||||
size: 1024, 1024
|
||||
filter: Linear, Linear
|
||||
coin-front-logo
|
||||
bounds: 2, 570, 305, 302
|
||||
coin-front-shine-logo
|
||||
bounds: 2, 286, 282, 282
|
||||
coin-front-shine-spineboy
|
||||
bounds: 305, 283, 282, 282
|
||||
coin-front-spineboy
|
||||
bounds: 309, 567, 305, 302
|
||||
rotate: 90
|
||||
coin-side-round
|
||||
bounds: 2, 2, 144, 282
|
||||
coin-side-straight
|
||||
bounds: 286, 286, 17, 282
|
||||
shine
|
||||
bounds: 148, 39, 72, 245
|
||||
BIN
spine-monogame/spine-monogame-example/data/coin.png
Normal file
|
After Width: | Height: | Size: 251 KiB |
8001
spine-monogame/spine-monogame-example/data/mix-and-match-pro.json
Normal file
362
spine-monogame/spine-monogame-example/data/mix-and-match.atlas
Normal file
@ -0,0 +1,362 @@
|
||||
mix-and-match.png
|
||||
size: 1024, 512
|
||||
filter: Linear, Linear
|
||||
scale: 0.5
|
||||
base-head
|
||||
bounds: 587, 2, 95, 73
|
||||
boy/arm-front
|
||||
bounds: 558, 271, 36, 115
|
||||
boy/backpack
|
||||
bounds: 235, 109, 119, 153
|
||||
boy/backpack-pocket
|
||||
bounds: 328, 73, 34, 62
|
||||
rotate: 90
|
||||
boy/backpack-strap-front
|
||||
bounds: 665, 79, 38, 88
|
||||
boy/backpack-up
|
||||
bounds: 395, 364, 21, 70
|
||||
rotate: 90
|
||||
boy/body
|
||||
bounds: 251, 264, 97, 132
|
||||
rotate: 90
|
||||
boy/boot-ribbon-front
|
||||
bounds: 648, 131, 9, 11
|
||||
boy/collar
|
||||
bounds: 744, 4, 73, 29
|
||||
rotate: 90
|
||||
boy/ear
|
||||
bounds: 383, 109, 19, 23
|
||||
rotate: 90
|
||||
boy/eye-back-low-eyelid
|
||||
bounds: 739, 284, 17, 6
|
||||
rotate: 90
|
||||
boy/eye-back-pupil
|
||||
bounds: 832, 443, 8, 9
|
||||
rotate: 90
|
||||
boy/eye-back-up-eyelid
|
||||
bounds: 558, 264, 23, 5
|
||||
boy/eye-back-up-eyelid-back
|
||||
bounds: 802, 491, 19, 10
|
||||
rotate: 90
|
||||
boy/eye-front-low-eyelid
|
||||
bounds: 386, 363, 22, 7
|
||||
rotate: 90
|
||||
boy/eye-front-pupil
|
||||
bounds: 816, 389, 9, 9
|
||||
boy/eye-front-up-eyelid
|
||||
bounds: 160, 71, 31, 6
|
||||
rotate: 90
|
||||
boy/eye-front-up-eyelid-back
|
||||
bounds: 801, 434, 26, 9
|
||||
rotate: 90
|
||||
boy/eye-iris-back
|
||||
bounds: 618, 264, 17, 17
|
||||
boy/eye-iris-front
|
||||
bounds: 727, 264, 18, 18
|
||||
boy/eye-white-back
|
||||
bounds: 580, 131, 20, 12
|
||||
boy/eye-white-front
|
||||
bounds: 510, 130, 27, 13
|
||||
boy/eyebrow-back
|
||||
bounds: 751, 88, 20, 11
|
||||
rotate: 90
|
||||
boy/eyebrow-front
|
||||
bounds: 483, 130, 25, 11
|
||||
boy/hair-back
|
||||
bounds: 494, 388, 122, 81
|
||||
rotate: 90
|
||||
boy/hair-bangs
|
||||
bounds: 667, 284, 70, 37
|
||||
boy/hair-side
|
||||
bounds: 789, 374, 25, 43
|
||||
boy/hand-backfingers
|
||||
bounds: 467, 364, 19, 21
|
||||
boy/hand-front-fingers
|
||||
bounds: 488, 364, 19, 21
|
||||
boy/hat
|
||||
bounds: 615, 417, 93, 56
|
||||
rotate: 90
|
||||
boy/leg-front
|
||||
bounds: 138, 104, 31, 158
|
||||
boy/mouth-close
|
||||
bounds: 551, 365, 21, 5
|
||||
rotate: 90
|
||||
girl-blue-cape/mouth-close
|
||||
bounds: 551, 365, 21, 5
|
||||
rotate: 90
|
||||
girl-spring-dress/mouth-close
|
||||
bounds: 551, 365, 21, 5
|
||||
rotate: 90
|
||||
girl/mouth-close
|
||||
bounds: 551, 365, 21, 5
|
||||
rotate: 90
|
||||
boy/mouth-smile
|
||||
bounds: 705, 79, 29, 7
|
||||
boy/nose
|
||||
bounds: 836, 473, 17, 10
|
||||
rotate: 90
|
||||
boy/pompom
|
||||
bounds: 747, 273, 48, 43
|
||||
rotate: 90
|
||||
boy/zip
|
||||
bounds: 648, 144, 14, 23
|
||||
girl-blue-cape/back-eyebrow
|
||||
bounds: 602, 131, 18, 12
|
||||
girl-blue-cape/body-dress
|
||||
bounds: 2, 264, 109, 246
|
||||
girl-blue-cape/body-ribbon
|
||||
bounds: 615, 283, 50, 38
|
||||
girl-blue-cape/cape-back
|
||||
bounds: 2, 69, 134, 193
|
||||
girl-blue-cape/cape-back-up
|
||||
bounds: 386, 387, 123, 106
|
||||
rotate: 90
|
||||
girl-blue-cape/cape-ribbon
|
||||
bounds: 675, 264, 50, 18
|
||||
girl-blue-cape/cape-shoulder-back
|
||||
bounds: 751, 110, 49, 59
|
||||
girl-blue-cape/cape-shoulder-front
|
||||
bounds: 113, 264, 62, 76
|
||||
rotate: 90
|
||||
girl-blue-cape/cape-up-front
|
||||
bounds: 399, 264, 98, 117
|
||||
rotate: 90
|
||||
girl-blue-cape/ear
|
||||
bounds: 775, 2, 19, 23
|
||||
girl-spring-dress/ear
|
||||
bounds: 775, 2, 19, 23
|
||||
girl/ear
|
||||
bounds: 775, 2, 19, 23
|
||||
girl-blue-cape/eye-back-low-eyelid
|
||||
bounds: 802, 463, 17, 6
|
||||
girl-spring-dress/eye-back-low-eyelid
|
||||
bounds: 802, 463, 17, 6
|
||||
girl/eye-back-low-eyelid
|
||||
bounds: 802, 463, 17, 6
|
||||
girl-blue-cape/eye-back-pupil
|
||||
bounds: 816, 367, 8, 9
|
||||
girl-spring-dress/eye-back-pupil
|
||||
bounds: 816, 367, 8, 9
|
||||
girl/eye-back-pupil
|
||||
bounds: 816, 367, 8, 9
|
||||
girl-blue-cape/eye-back-up-eyelid
|
||||
bounds: 554, 131, 24, 12
|
||||
girl-spring-dress/eye-back-up-eyelid
|
||||
bounds: 554, 131, 24, 12
|
||||
girl/eye-back-up-eyelid
|
||||
bounds: 554, 131, 24, 12
|
||||
girl-blue-cape/eye-back-up-eyelid-back
|
||||
bounds: 832, 453, 17, 11
|
||||
rotate: 90
|
||||
girl-spring-dress/eye-back-up-eyelid-back
|
||||
bounds: 832, 453, 17, 11
|
||||
rotate: 90
|
||||
girl/eye-back-up-eyelid-back
|
||||
bounds: 832, 453, 17, 11
|
||||
rotate: 90
|
||||
girl-blue-cape/eye-front-low-eyelid
|
||||
bounds: 739, 303, 18, 6
|
||||
rotate: 90
|
||||
girl-spring-dress/eye-front-low-eyelid
|
||||
bounds: 739, 303, 18, 6
|
||||
rotate: 90
|
||||
girl/eye-front-low-eyelid
|
||||
bounds: 739, 303, 18, 6
|
||||
rotate: 90
|
||||
girl-blue-cape/eye-front-pupil
|
||||
bounds: 816, 378, 9, 9
|
||||
girl-spring-dress/eye-front-pupil
|
||||
bounds: 816, 378, 9, 9
|
||||
girl/eye-front-pupil
|
||||
bounds: 816, 378, 9, 9
|
||||
girl-blue-cape/eye-front-up-eyelid
|
||||
bounds: 392, 77, 30, 14
|
||||
rotate: 90
|
||||
girl-spring-dress/eye-front-up-eyelid
|
||||
bounds: 392, 77, 30, 14
|
||||
rotate: 90
|
||||
girl/eye-front-up-eyelid
|
||||
bounds: 392, 77, 30, 14
|
||||
rotate: 90
|
||||
girl-blue-cape/eye-front-up-eyelid-back
|
||||
bounds: 455, 130, 26, 11
|
||||
girl-spring-dress/eye-front-up-eyelid-back
|
||||
bounds: 455, 130, 26, 11
|
||||
girl/eye-front-up-eyelid-back
|
||||
bounds: 455, 130, 26, 11
|
||||
girl-blue-cape/eye-iris-back
|
||||
bounds: 637, 264, 17, 17
|
||||
girl-blue-cape/eye-iris-front
|
||||
bounds: 802, 471, 18, 18
|
||||
girl-blue-cape/eye-white-back
|
||||
bounds: 596, 264, 20, 16
|
||||
girl-spring-dress/eye-white-back
|
||||
bounds: 596, 264, 20, 16
|
||||
girl-blue-cape/eye-white-front
|
||||
bounds: 796, 5, 20, 16
|
||||
rotate: 90
|
||||
girl-spring-dress/eye-white-front
|
||||
bounds: 796, 5, 20, 16
|
||||
rotate: 90
|
||||
girl/eye-white-front
|
||||
bounds: 796, 5, 20, 16
|
||||
rotate: 90
|
||||
girl-blue-cape/front-eyebrow
|
||||
bounds: 608, 149, 18, 12
|
||||
rotate: 90
|
||||
girl-blue-cape/hair-back
|
||||
bounds: 508, 145, 117, 98
|
||||
rotate: 90
|
||||
girl-blue-cape/hair-bangs
|
||||
bounds: 673, 419, 91, 40
|
||||
rotate: 90
|
||||
girl-blue-cape/hair-head-side-back
|
||||
bounds: 196, 331, 30, 52
|
||||
rotate: 90
|
||||
girl-blue-cape/hair-head-side-front
|
||||
bounds: 738, 323, 41, 42
|
||||
girl-blue-cape/hair-side
|
||||
bounds: 473, 3, 36, 71
|
||||
girl-blue-cape/hand-front-fingers
|
||||
bounds: 509, 365, 19, 21
|
||||
girl-spring-dress/hand-front-fingers
|
||||
bounds: 509, 365, 19, 21
|
||||
girl-blue-cape/leg-front
|
||||
bounds: 168, 72, 30, 158
|
||||
rotate: 90
|
||||
girl-blue-cape/mouth-smile
|
||||
bounds: 736, 79, 29, 7
|
||||
girl-spring-dress/mouth-smile
|
||||
bounds: 736, 79, 29, 7
|
||||
girl/mouth-smile
|
||||
bounds: 736, 79, 29, 7
|
||||
girl-blue-cape/nose
|
||||
bounds: 747, 264, 11, 7
|
||||
girl-spring-dress/nose
|
||||
bounds: 747, 264, 11, 7
|
||||
girl/nose
|
||||
bounds: 747, 264, 11, 7
|
||||
girl-blue-cape/sleeve-back
|
||||
bounds: 767, 79, 42, 29
|
||||
girl-blue-cape/sleeve-front
|
||||
bounds: 408, 76, 52, 119
|
||||
rotate: 90
|
||||
girl-spring-dress/arm-front
|
||||
bounds: 596, 282, 17, 111
|
||||
girl-spring-dress/back-eyebrow
|
||||
bounds: 801, 420, 18, 12
|
||||
girl-spring-dress/body-up
|
||||
bounds: 179, 4, 64, 66
|
||||
girl-spring-dress/cloak-down
|
||||
bounds: 775, 27, 50, 50
|
||||
girl-spring-dress/cloak-up
|
||||
bounds: 360, 7, 64, 58
|
||||
rotate: 90
|
||||
girl-spring-dress/eye-iris-back
|
||||
bounds: 656, 264, 17, 17
|
||||
girl-spring-dress/eye-iris-front
|
||||
bounds: 814, 492, 18, 18
|
||||
girl-spring-dress/front-eyebrow
|
||||
bounds: 822, 472, 18, 12
|
||||
rotate: 90
|
||||
girl-spring-dress/hair-back
|
||||
bounds: 196, 363, 147, 93
|
||||
rotate: 90
|
||||
girl-spring-dress/hair-bangs
|
||||
bounds: 696, 326, 91, 40
|
||||
rotate: 90
|
||||
girl-spring-dress/hair-head-side-back
|
||||
bounds: 529, 76, 30, 52
|
||||
girl-spring-dress/hair-head-side-front
|
||||
bounds: 781, 323, 41, 42
|
||||
girl-spring-dress/hair-side
|
||||
bounds: 511, 3, 36, 71
|
||||
girl-spring-dress/leg-front
|
||||
bounds: 171, 104, 30, 158
|
||||
girl-spring-dress/neck
|
||||
bounds: 138, 70, 20, 32
|
||||
girl-spring-dress/shoulder-ribbon
|
||||
bounds: 622, 131, 36, 24
|
||||
rotate: 90
|
||||
girl-spring-dress/skirt
|
||||
bounds: 113, 328, 182, 81
|
||||
rotate: 90
|
||||
girl-spring-dress/underskirt
|
||||
bounds: 2, 2, 175, 65
|
||||
girl/arm-front
|
||||
bounds: 577, 395, 36, 115
|
||||
girl/back-eyebrow
|
||||
bounds: 834, 492, 18, 12
|
||||
rotate: 90
|
||||
girl/bag-base
|
||||
bounds: 191, 264, 62, 58
|
||||
rotate: 90
|
||||
girl/bag-strap-front
|
||||
bounds: 385, 265, 12, 96
|
||||
girl/bag-top
|
||||
bounds: 738, 367, 49, 50
|
||||
girl/body
|
||||
bounds: 356, 130, 97, 132
|
||||
girl/boot-ribbon-front
|
||||
bounds: 539, 130, 13, 13
|
||||
girl/eye-iris-back
|
||||
bounds: 821, 424, 17, 17
|
||||
girl/eye-iris-front
|
||||
bounds: 812, 443, 18, 18
|
||||
girl/eye-white-back
|
||||
bounds: 814, 5, 20, 16
|
||||
rotate: 90
|
||||
girl/front-eyebrow
|
||||
bounds: 816, 400, 18, 12
|
||||
rotate: 90
|
||||
girl/hair-back
|
||||
bounds: 291, 363, 147, 93
|
||||
rotate: 90
|
||||
girl/hair-bangs
|
||||
bounds: 715, 419, 91, 40
|
||||
rotate: 90
|
||||
girl/hair-flap-down-front
|
||||
bounds: 288, 5, 70, 65
|
||||
girl/hair-head-side-back
|
||||
bounds: 561, 77, 30, 52
|
||||
girl/hair-head-side-front
|
||||
bounds: 757, 419, 41, 42
|
||||
rotate: 90
|
||||
girl/hair-patch
|
||||
bounds: 245, 4, 66, 41
|
||||
rotate: 90
|
||||
girl/hair-side
|
||||
bounds: 549, 3, 36, 71
|
||||
girl/hair-strand-back-1
|
||||
bounds: 684, 3, 58, 74
|
||||
girl/hair-strand-back-2
|
||||
bounds: 692, 171, 91, 58
|
||||
rotate: 90
|
||||
girl/hair-strand-back-3
|
||||
bounds: 615, 323, 92, 79
|
||||
rotate: 90
|
||||
girl/hair-strand-front-1
|
||||
bounds: 518, 269, 38, 94
|
||||
girl/hair-strand-front-2
|
||||
bounds: 593, 79, 70, 50
|
||||
girl/hair-strand-front-3
|
||||
bounds: 705, 88, 44, 81
|
||||
girl/hand-front-fingers
|
||||
bounds: 530, 365, 19, 21
|
||||
girl/hat
|
||||
bounds: 608, 169, 93, 82
|
||||
rotate: 90
|
||||
girl/leg-front
|
||||
bounds: 203, 104, 30, 158
|
||||
girl/pompom
|
||||
bounds: 757, 462, 48, 43
|
||||
rotate: 90
|
||||
girl/scarf
|
||||
bounds: 455, 143, 119, 51
|
||||
rotate: 90
|
||||
girl/scarf-back
|
||||
bounds: 420, 2, 72, 51
|
||||
rotate: 90
|
||||
girl/zip
|
||||
bounds: 356, 109, 19, 25
|
||||
rotate: 90
|
||||
BIN
spine-monogame/spine-monogame-example/data/mix-and-match.png
Normal file
|
After Width: | Height: | Size: 340 KiB |
9154
spine-monogame/spine-monogame-example/data/raptor-pro.json
Normal file
99
spine-monogame/spine-monogame-example/data/raptor.atlas
Normal file
@ -0,0 +1,99 @@
|
||||
raptor.png
|
||||
size: 1024, 512
|
||||
filter: Linear, Linear
|
||||
back-arm
|
||||
bounds: 829, 88, 46, 25
|
||||
rotate: 90
|
||||
back-bracer
|
||||
bounds: 195, 238, 39, 28
|
||||
rotate: 90
|
||||
back-hand
|
||||
bounds: 724, 140, 36, 34
|
||||
rotate: 90
|
||||
back-knee
|
||||
bounds: 760, 131, 49, 67
|
||||
rotate: 90
|
||||
back-thigh
|
||||
bounds: 225, 238, 39, 24
|
||||
rotate: 90
|
||||
eyes-open
|
||||
bounds: 975, 204, 47, 45
|
||||
front-arm
|
||||
bounds: 969, 112, 48, 26
|
||||
front-bracer
|
||||
bounds: 724, 97, 41, 29
|
||||
rotate: 90
|
||||
front-hand
|
||||
bounds: 251, 239, 41, 38
|
||||
front-open-hand
|
||||
bounds: 856, 76, 43, 44
|
||||
rotate: 90
|
||||
front-thigh
|
||||
bounds: 729, 178, 57, 29
|
||||
rotate: 90
|
||||
gun
|
||||
bounds: 894, 251, 107, 103
|
||||
gun-nohand
|
||||
bounds: 764, 241, 105, 102
|
||||
head
|
||||
bounds: 756, 345, 136, 149
|
||||
lower-leg
|
||||
bounds: 475, 237, 73, 98
|
||||
rotate: 90
|
||||
mouth-grind
|
||||
bounds: 975, 172, 47, 30
|
||||
mouth-smile
|
||||
bounds: 975, 140, 47, 30
|
||||
neck
|
||||
bounds: 366, 282, 18, 21
|
||||
raptor-back-arm
|
||||
bounds: 636, 97, 82, 86
|
||||
rotate: 90
|
||||
raptor-body
|
||||
bounds: 2, 2, 632, 233
|
||||
raptor-front-arm
|
||||
bounds: 871, 168, 81, 102
|
||||
rotate: 90
|
||||
raptor-front-leg
|
||||
bounds: 2, 237, 191, 257
|
||||
raptor-hindleg-back
|
||||
bounds: 195, 279, 169, 215
|
||||
raptor-horn
|
||||
bounds: 431, 312, 182, 80
|
||||
rotate: 90
|
||||
raptor-horn-back
|
||||
bounds: 513, 318, 176, 77
|
||||
rotate: 90
|
||||
raptor-jaw
|
||||
bounds: 894, 356, 126, 138
|
||||
raptor-jaw-tooth
|
||||
bounds: 294, 240, 37, 48
|
||||
rotate: 90
|
||||
raptor-mouth-inside
|
||||
bounds: 344, 241, 36, 41
|
||||
rotate: 90
|
||||
raptor-saddle-strap-back
|
||||
bounds: 575, 242, 54, 74
|
||||
raptor-saddle-strap-front
|
||||
bounds: 764, 182, 57, 95
|
||||
rotate: 90
|
||||
raptor-saddle-w-shadow
|
||||
bounds: 592, 323, 162, 171
|
||||
raptor-tail-shadow
|
||||
bounds: 366, 305, 189, 63
|
||||
rotate: 90
|
||||
raptor-tongue
|
||||
bounds: 387, 239, 86, 64
|
||||
stirrup-back
|
||||
bounds: 829, 136, 44, 35
|
||||
rotate: 90
|
||||
stirrup-front
|
||||
bounds: 866, 121, 45, 50
|
||||
rotate: 90
|
||||
stirrup-strap
|
||||
bounds: 918, 120, 49, 46
|
||||
torso
|
||||
bounds: 636, 181, 54, 91
|
||||
rotate: 90
|
||||
visor
|
||||
bounds: 631, 237, 131, 84
|
||||
BIN
spine-monogame/spine-monogame-example/data/raptor.png
Normal file
|
After Width: | Height: | Size: 412 KiB |
BIN
spine-monogame/spine-monogame-example/data/raptor_normals.png
Normal file
|
After Width: | Height: | Size: 518 KiB |
BIN
spine-monogame/spine-monogame-example/data/spineboy-pro.skel
Normal file
101
spine-monogame/spine-monogame-example/data/spineboy.atlas
Normal file
@ -0,0 +1,101 @@
|
||||
spineboy.png
|
||||
size: 1024, 256
|
||||
filter: Linear, Linear
|
||||
scale: 0.5
|
||||
crosshair
|
||||
bounds: 813, 160, 45, 45
|
||||
eye-indifferent
|
||||
bounds: 569, 2, 47, 45
|
||||
eye-surprised
|
||||
bounds: 643, 7, 47, 45
|
||||
rotate: 90
|
||||
front-bracer
|
||||
bounds: 811, 51, 29, 40
|
||||
front-fist-closed
|
||||
bounds: 807, 93, 38, 41
|
||||
front-fist-open
|
||||
bounds: 815, 210, 43, 44
|
||||
front-foot
|
||||
bounds: 706, 64, 63, 35
|
||||
rotate: 90
|
||||
front-shin
|
||||
bounds: 80, 11, 41, 92
|
||||
front-thigh
|
||||
bounds: 754, 12, 23, 56
|
||||
front-upper-arm
|
||||
bounds: 618, 5, 23, 49
|
||||
goggles
|
||||
bounds: 214, 20, 131, 83
|
||||
gun
|
||||
bounds: 347, 14, 105, 102
|
||||
rotate: 90
|
||||
head
|
||||
bounds: 80, 105, 136, 149
|
||||
hoverboard-board
|
||||
bounds: 2, 8, 246, 76
|
||||
rotate: 90
|
||||
hoverboard-thruster
|
||||
bounds: 478, 2, 30, 32
|
||||
hoverglow-small
|
||||
bounds: 218, 117, 137, 38
|
||||
rotate: 90
|
||||
mouth-grind
|
||||
bounds: 775, 80, 47, 30
|
||||
rotate: 90
|
||||
mouth-oooo
|
||||
bounds: 779, 31, 47, 30
|
||||
rotate: 90
|
||||
mouth-smile
|
||||
bounds: 783, 207, 47, 30
|
||||
rotate: 90
|
||||
muzzle-glow
|
||||
bounds: 779, 4, 25, 25
|
||||
muzzle-ring
|
||||
bounds: 451, 14, 25, 105
|
||||
muzzle01
|
||||
bounds: 664, 60, 67, 40
|
||||
rotate: 90
|
||||
muzzle02
|
||||
bounds: 580, 56, 68, 42
|
||||
rotate: 90
|
||||
muzzle03
|
||||
bounds: 478, 36, 83, 53
|
||||
rotate: 90
|
||||
muzzle04
|
||||
bounds: 533, 49, 75, 45
|
||||
rotate: 90
|
||||
muzzle05
|
||||
bounds: 624, 56, 68, 38
|
||||
rotate: 90
|
||||
neck
|
||||
bounds: 806, 8, 18, 21
|
||||
portal-bg
|
||||
bounds: 258, 121, 133, 133
|
||||
portal-flare1
|
||||
bounds: 690, 2, 56, 30
|
||||
rotate: 90
|
||||
portal-flare2
|
||||
bounds: 510, 3, 57, 31
|
||||
portal-flare3
|
||||
bounds: 722, 4, 58, 30
|
||||
rotate: 90
|
||||
portal-shade
|
||||
bounds: 393, 121, 133, 133
|
||||
portal-streaks1
|
||||
bounds: 528, 126, 126, 128
|
||||
portal-streaks2
|
||||
bounds: 656, 129, 125, 125
|
||||
rear-bracer
|
||||
bounds: 826, 13, 28, 36
|
||||
rear-foot
|
||||
bounds: 743, 70, 57, 30
|
||||
rotate: 90
|
||||
rear-shin
|
||||
bounds: 174, 14, 38, 89
|
||||
rear-thigh
|
||||
bounds: 783, 158, 28, 47
|
||||
rear-upper-arm
|
||||
bounds: 783, 136, 20, 44
|
||||
rotate: 90
|
||||
torso
|
||||
bounds: 123, 13, 49, 90
|
||||
BIN
spine-monogame/spine-monogame-example/data/spineboy.png
Normal file
|
After Width: | Height: | Size: 238 KiB |
5020
spine-monogame/spine-monogame-example/data/tank-pro.json
Normal file
56
spine-monogame/spine-monogame-example/data/tank.atlas
Normal file
@ -0,0 +1,56 @@
|
||||
tank.png
|
||||
size: 1024, 1024
|
||||
filter: Linear, Linear
|
||||
scale: 0.5
|
||||
antenna
|
||||
bounds: 2, 712, 11, 152
|
||||
rotate: 90
|
||||
cannon
|
||||
bounds: 222, 694, 466, 29
|
||||
cannon-connector
|
||||
bounds: 82, 654, 56, 68
|
||||
rotate: 90
|
||||
ground
|
||||
bounds: 2, 175, 512, 177
|
||||
guntower
|
||||
bounds: 647, 347, 365, 145
|
||||
machinegun
|
||||
bounds: 690, 694, 166, 29
|
||||
machinegun-mount
|
||||
bounds: 858, 687, 36, 48
|
||||
rotate: 90
|
||||
rock
|
||||
bounds: 664, 607, 290, 64
|
||||
smoke-glow
|
||||
bounds: 946, 673, 50, 50
|
||||
smoke-puff01-bg
|
||||
bounds: 312, 630, 92, 62
|
||||
smoke-puff01-fg
|
||||
bounds: 222, 633, 88, 59
|
||||
smoke-puff02-fg
|
||||
bounds: 406, 630, 92, 62
|
||||
smoke-puff03-fg
|
||||
bounds: 500, 630, 92, 62
|
||||
smoke-puff04-fg
|
||||
bounds: 2, 662, 78, 48
|
||||
tank-bottom
|
||||
bounds: 2, 354, 643, 138
|
||||
tank-bottom-shadow
|
||||
bounds: 2, 2, 646, 171
|
||||
tank-top
|
||||
bounds: 195, 494, 704, 111
|
||||
tread
|
||||
bounds: 172, 708, 48, 15
|
||||
tread-inside
|
||||
bounds: 156, 710, 13, 14
|
||||
rotate: 90
|
||||
wheel-big
|
||||
bounds: 97, 540, 96, 96
|
||||
wheel-big-overlay
|
||||
bounds: 2, 559, 93, 93
|
||||
wheel-mid
|
||||
bounds: 594, 624, 68, 68
|
||||
wheel-mid-overlay
|
||||
bounds: 152, 638, 68, 68
|
||||
wheel-small
|
||||
bounds: 908, 687, 36, 36
|
||||
BIN
spine-monogame/spine-monogame-example/data/tank.png
Normal file
|
After Width: | Height: | Size: 418 KiB |
@ -0,0 +1,58 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<PublishReadyToRun>false</PublishReadyToRun>
|
||||
<TieredCompilation>false</TieredCompilation>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<ApplicationIcon>Icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Icon.ico" />
|
||||
<None Remove="Icon.bmp" />
|
||||
<None Remove="Content\skeletons\coin-pro.json" />
|
||||
<None Remove="Content\skeletons\coin-pro.skel" />
|
||||
<None Remove="Content\skeletons\coin.atlas" />
|
||||
<None Remove="Content\skeletons\coin.png" />
|
||||
<None Remove="Content\skeletons\mix-and-match-pro.json" />
|
||||
<None Remove="Content\skeletons\mix-and-match.atlas" />
|
||||
<None Remove="Content\skeletons\mix-and-match.png" />
|
||||
<None Remove="Content\skeletons\raptor_normals.png" />
|
||||
<None Remove="Content\skeletons\raptor-pro.json" />
|
||||
<None Remove="Content\skeletons\raptor.atlas" />
|
||||
<None Remove="Content\skeletons\raptor.png" />
|
||||
<None Remove="Content\skeletons\spineboy-pro.skel" />
|
||||
<None Remove="Content\skeletons\spineboy.atlas" />
|
||||
<None Remove="Content\skeletons\spineboy.png" />
|
||||
<None Remove="Content\skeletons\tank-pro.json" />
|
||||
<None Remove="Content\skeletons\tank.atlas" />
|
||||
<None Remove="Content\skeletons\tank.png" />
|
||||
<None Remove="Content\shaders\SpineEffect.fx" />
|
||||
<None Remove="Content\shaders\SpineEffectOutline.fx" />
|
||||
<None Remove="Content\shaders\SpineEffectNormalmap.fx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Icon.ico" />
|
||||
<EmbeddedResource Include="Icon.bmp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<MonoGameContentReference Include="Content\Content.mgcb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<TrimmerRootAssembly Include="Microsoft.Xna.Framework.Content.ContentTypeReader" Visible="false" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641" />
|
||||
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.0.1641" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\spine-monogame\spine-monogame.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\shaders\SpineEffect.fx" />
|
||||
<Content Include="Content\shaders\SpineEffectOutline.fx" />
|
||||
<Content Include="Content\shaders\SpineEffectNormalmap.fx" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
31
spine-monogame/spine-monogame.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.810.17
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "spine-monogame-example", "spine-monogame-example\spine-monogame-example.csproj", "{B6A0B6D0-1186-46A6-89C5-4CD15CA6C18D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "spine-monogame", "spine-monogame\spine-monogame.csproj", "{82271611-1E77-4E5F-B78A-18F8CDBFDF84}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B6A0B6D0-1186-46A6-89C5-4CD15CA6C18D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B6A0B6D0-1186-46A6-89C5-4CD15CA6C18D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B6A0B6D0-1186-46A6-89C5-4CD15CA6C18D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B6A0B6D0-1186-46A6-89C5-4CD15CA6C18D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{82271611-1E77-4E5F-B78A-18F8CDBFDF84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{82271611-1E77-4E5F-B78A-18F8CDBFDF84}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{82271611-1E77-4E5F-B78A-18F8CDBFDF84}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{82271611-1E77-4E5F-B78A-18F8CDBFDF84}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {1D10CEBB-7A36-4BCD-A598-BF9A61769961}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@ -13,9 +13,3 @@
|
||||
|
||||
#---------------------------------- Content ---------------------------------#
|
||||
|
||||
#begin SpineEffect.fx
|
||||
/importer:EffectImporter
|
||||
/processor:EffectProcessor
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:SpineEffect.fx
|
||||
|
||||
318
spine-monogame/spine-monogame/spine-monogame.csproj
Normal file
@ -0,0 +1,318 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641">
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="spine-csharp\" />
|
||||
<None Remove="spine-csharp\Attachments\" />
|
||||
<None Remove="src\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="spine-csharp\" />
|
||||
<Folder Include="spine-csharp\Attachments\" />
|
||||
<Folder Include="src\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\spine-csharp\src\Animation.cs">
|
||||
<Link>spine-csharp\Animation.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\AnimationState.cs">
|
||||
<Link>spine-csharp\AnimationState.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\AnimationStateData.cs">
|
||||
<Link>spine-csharp\AnimationStateData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Atlas.cs">
|
||||
<Link>spine-csharp\Atlas.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\BlendMode.cs">
|
||||
<Link>spine-csharp\BlendMode.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Bone.cs">
|
||||
<Link>spine-csharp\Bone.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\BoneData.cs">
|
||||
<Link>spine-csharp\BoneData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\ConstraintData.cs">
|
||||
<Link>spine-csharp\ConstraintData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Event.cs">
|
||||
<Link>spine-csharp\Event.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\EventData.cs">
|
||||
<Link>spine-csharp\EventData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\ExposedList.cs">
|
||||
<Link>spine-csharp\ExposedList.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\IkConstraint.cs">
|
||||
<Link>spine-csharp\IkConstraint.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\IkConstraintData.cs">
|
||||
<Link>spine-csharp\IkConstraintData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\IUpdatable.cs">
|
||||
<Link>spine-csharp\IUpdatable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Json.cs">
|
||||
<Link>spine-csharp\Json.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\MathUtils.cs">
|
||||
<Link>spine-csharp\MathUtils.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PathConstraint.cs">
|
||||
<Link>spine-csharp\PathConstraint.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PathConstraintData.cs">
|
||||
<Link>spine-csharp\PathConstraintData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Skeleton.cs">
|
||||
<Link>spine-csharp\Skeleton.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonBinary.cs">
|
||||
<Link>spine-csharp\SkeletonBinary.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonBounds.cs">
|
||||
<Link>spine-csharp\SkeletonBounds.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonClipping.cs">
|
||||
<Link>spine-csharp\SkeletonClipping.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonData.cs">
|
||||
<Link>spine-csharp\SkeletonData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonJson.cs">
|
||||
<Link>spine-csharp\SkeletonJson.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonLoader.cs">
|
||||
<Link>spine-csharp\SkeletonLoader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Skin.cs">
|
||||
<Link>spine-csharp\Skin.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Slot.cs">
|
||||
<Link>spine-csharp\Slot.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SlotData.cs">
|
||||
<Link>spine-csharp\SlotData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SpringConstraint.cs">
|
||||
<Link>spine-csharp\SpringConstraint.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SpringConstraintData.cs">
|
||||
<Link>spine-csharp\SpringConstraintData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\TextureRegion.cs">
|
||||
<Link>spine-csharp\TextureRegion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\TransformConstraint.cs">
|
||||
<Link>spine-csharp\TransformConstraint.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\TransformConstraintData.cs">
|
||||
<Link>spine-csharp\TransformConstraintData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Triangulator.cs">
|
||||
<Link>spine-csharp\Triangulator.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\AtlasAttachmentLoader.cs">
|
||||
<Link>spine-csharp\Attachments\AtlasAttachmentLoader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\Attachment.cs">
|
||||
<Link>spine-csharp\Attachments\Attachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\AttachmentLoader.cs">
|
||||
<Link>spine-csharp\Attachments\AttachmentLoader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\AttachmentType.cs">
|
||||
<Link>spine-csharp\Attachments\AttachmentType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\BoundingBoxAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\BoundingBoxAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\ClippingAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\ClippingAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\IHasTextureRegion.cs">
|
||||
<Link>spine-csharp\Attachments\IHasTextureRegion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\MeshAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\MeshAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\PathAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\PathAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\PointAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\PointAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\RegionAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\RegionAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\Sequence.cs">
|
||||
<Link>spine-csharp\Attachments\Sequence.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\VertexAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\VertexAttachment.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\spine-csharp\src\Animation.cs.meta">
|
||||
<Link>spine-csharp\Animation.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\AnimationState.cs.meta">
|
||||
<Link>spine-csharp\AnimationState.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\AnimationStateData.cs.meta">
|
||||
<Link>spine-csharp\AnimationStateData.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Atlas.cs.meta">
|
||||
<Link>spine-csharp\Atlas.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments.meta">
|
||||
<Link>spine-csharp\Attachments.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\BlendMode.cs.meta">
|
||||
<Link>spine-csharp\BlendMode.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Bone.cs.meta">
|
||||
<Link>spine-csharp\Bone.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\BoneData.cs.meta">
|
||||
<Link>spine-csharp\BoneData.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\ConstraintData.cs.meta">
|
||||
<Link>spine-csharp\ConstraintData.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Event.cs.meta">
|
||||
<Link>spine-csharp\Event.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\EventData.cs.meta">
|
||||
<Link>spine-csharp\EventData.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\ExposedList.cs.meta">
|
||||
<Link>spine-csharp\ExposedList.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\IkConstraint.cs.meta">
|
||||
<Link>spine-csharp\IkConstraint.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\IkConstraintData.cs.meta">
|
||||
<Link>spine-csharp\IkConstraintData.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\IUpdatable.cs.meta">
|
||||
<Link>spine-csharp\IUpdatable.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Json.cs.meta">
|
||||
<Link>spine-csharp\Json.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\MathUtils.cs.meta">
|
||||
<Link>spine-csharp\MathUtils.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\package.json">
|
||||
<Link>spine-csharp\package.json</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\package.json.meta">
|
||||
<Link>spine-csharp\package.json.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\PathConstraint.cs.meta">
|
||||
<Link>spine-csharp\PathConstraint.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\PathConstraintData.cs.meta">
|
||||
<Link>spine-csharp\PathConstraintData.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Skeleton.cs.meta">
|
||||
<Link>spine-csharp\Skeleton.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\SkeletonBinary.cs.meta">
|
||||
<Link>spine-csharp\SkeletonBinary.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\SkeletonBounds.cs.meta">
|
||||
<Link>spine-csharp\SkeletonBounds.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\SkeletonClipping.cs.meta">
|
||||
<Link>spine-csharp\SkeletonClipping.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\SkeletonData.cs.meta">
|
||||
<Link>spine-csharp\SkeletonData.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\SkeletonJson.cs.meta">
|
||||
<Link>spine-csharp\SkeletonJson.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\SkeletonLoader.cs.meta">
|
||||
<Link>spine-csharp\SkeletonLoader.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Skin.cs.meta">
|
||||
<Link>spine-csharp\Skin.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Slot.cs.meta">
|
||||
<Link>spine-csharp\Slot.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\SlotData.cs.meta">
|
||||
<Link>spine-csharp\SlotData.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\spine-csharp.asmdef">
|
||||
<Link>spine-csharp\spine-csharp.asmdef</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\spine-csharp.asmdef.meta">
|
||||
<Link>spine-csharp\spine-csharp.asmdef.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\SpringConstraint.cs.meta">
|
||||
<Link>spine-csharp\SpringConstraint.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\SpringConstraintData.cs.meta">
|
||||
<Link>spine-csharp\SpringConstraintData.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\TransformConstraint.cs.meta">
|
||||
<Link>spine-csharp\TransformConstraint.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\TransformConstraintData.cs.meta">
|
||||
<Link>spine-csharp\TransformConstraintData.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Triangulator.cs.meta">
|
||||
<Link>spine-csharp\Triangulator.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\AtlasAttachmentLoader.cs.meta">
|
||||
<Link>spine-csharp\Attachments\AtlasAttachmentLoader.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\Attachment.cs.meta">
|
||||
<Link>spine-csharp\Attachments\Attachment.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\AttachmentLoader.cs.meta">
|
||||
<Link>spine-csharp\Attachments\AttachmentLoader.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\AttachmentType.cs.meta">
|
||||
<Link>spine-csharp\Attachments\AttachmentType.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\BoundingBoxAttachment.cs.meta">
|
||||
<Link>spine-csharp\Attachments\BoundingBoxAttachment.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\ClippingAttachment.cs.meta">
|
||||
<Link>spine-csharp\Attachments\ClippingAttachment.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\IHasTextureRegion.cs.meta">
|
||||
<Link>spine-csharp\Attachments\IHasTextureRegion.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\MeshAttachment.cs.meta">
|
||||
<Link>spine-csharp\Attachments\MeshAttachment.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\PathAttachment.cs.meta">
|
||||
<Link>spine-csharp\Attachments\PathAttachment.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\PointAttachment.cs.meta">
|
||||
<Link>spine-csharp\Attachments\PointAttachment.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\RegionAttachment.cs.meta">
|
||||
<Link>spine-csharp\Attachments\RegionAttachment.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\Sequence.cs.meta">
|
||||
<Link>spine-csharp\Attachments\Sequence.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Attachments\VertexAttachment.cs.meta">
|
||||
<Link>spine-csharp\Attachments\VertexAttachment.cs.meta</Link>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
195
spine-monogame/spine-monogame/src/MeshBatcher.cs
Normal file
@ -0,0 +1,195 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated September 24, 2021. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2021, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Spine {
|
||||
public struct VertexPositionColorTextureColor : IVertexType {
|
||||
public Vector3 Position;
|
||||
public Color Color;
|
||||
public Vector2 TextureCoordinate;
|
||||
public Color Color2;
|
||||
|
||||
public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration
|
||||
(
|
||||
new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
|
||||
new VertexElement(12, VertexElementFormat.Color, VertexElementUsage.Color, 0),
|
||||
new VertexElement(16, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0),
|
||||
new VertexElement(24, VertexElementFormat.Color, VertexElementUsage.Color, 1)
|
||||
);
|
||||
|
||||
VertexDeclaration IVertexType.VertexDeclaration {
|
||||
get { return VertexDeclaration; }
|
||||
}
|
||||
}
|
||||
|
||||
// #region License
|
||||
// /*
|
||||
// Microsoft Public License (Ms-PL)
|
||||
// MonoGame - Copyright <20> 2009 The MonoGame Team
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// This license governs use of the accompanying software. If you use the software, you accept this license. If you do not
|
||||
// accept the license, do not use the software.
|
||||
//
|
||||
// 1. Definitions
|
||||
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under
|
||||
// U.S. copyright law.
|
||||
//
|
||||
// A "contribution" is the original software, or any additions or changes to the software.
|
||||
// A "contributor" is any person that distributes its contribution under this license.
|
||||
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
//
|
||||
// 2. Grant of Rights
|
||||
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
|
||||
// each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
|
||||
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
|
||||
// each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
|
||||
//
|
||||
// 3. Conditions and Limitations
|
||||
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software,
|
||||
// your patent license from such contributor to the software ends automatically.
|
||||
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
|
||||
// notices that are present in the software.
|
||||
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
|
||||
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object
|
||||
// code form, you may only do so under a license that complies with this license.
|
||||
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees
|
||||
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent
|
||||
// permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular
|
||||
// purpose and non-infringement.
|
||||
// */
|
||||
// #endregion License
|
||||
//
|
||||
|
||||
/// <summary>Draws batched meshes.</summary>
|
||||
public class MeshBatcher {
|
||||
private readonly List<MeshItem> items;
|
||||
private readonly Queue<MeshItem> freeItems;
|
||||
private VertexPositionColorTextureColor[] vertexArray = { };
|
||||
private short[] triangles = { };
|
||||
|
||||
public MeshBatcher () {
|
||||
items = new List<MeshItem>(256);
|
||||
freeItems = new Queue<MeshItem>(256);
|
||||
EnsureCapacity(256, 512);
|
||||
}
|
||||
|
||||
/// <summary>Returns a pooled MeshItem.</summary>
|
||||
public MeshItem NextItem (int vertexCount, int triangleCount) {
|
||||
MeshItem item = freeItems.Count > 0 ? freeItems.Dequeue() : new MeshItem();
|
||||
if (item.vertices.Length < vertexCount) item.vertices = new VertexPositionColorTextureColor[vertexCount];
|
||||
if (item.triangles.Length < triangleCount) item.triangles = new int[triangleCount];
|
||||
item.vertexCount = vertexCount;
|
||||
item.triangleCount = triangleCount;
|
||||
items.Add(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
private void EnsureCapacity (int vertexCount, int triangleCount) {
|
||||
if (vertexArray.Length < vertexCount) vertexArray = new VertexPositionColorTextureColor[vertexCount];
|
||||
if (triangles.Length < triangleCount) triangles = new short[triangleCount];
|
||||
}
|
||||
|
||||
public void Draw (GraphicsDevice device) {
|
||||
if (items.Count == 0) return;
|
||||
|
||||
int itemCount = items.Count;
|
||||
int vertexCount = 0, triangleCount = 0;
|
||||
for (int i = 0; i < itemCount; i++) {
|
||||
MeshItem item = items[i];
|
||||
vertexCount += item.vertexCount;
|
||||
triangleCount += item.triangleCount;
|
||||
}
|
||||
EnsureCapacity(vertexCount, triangleCount);
|
||||
|
||||
vertexCount = 0;
|
||||
triangleCount = 0;
|
||||
Texture2D lastTexture = null;
|
||||
for (int i = 0; i < itemCount; i++) {
|
||||
MeshItem item = items[i];
|
||||
int itemVertexCount = item.vertexCount;
|
||||
|
||||
if (item.texture != lastTexture || vertexCount + itemVertexCount > short.MaxValue) {
|
||||
FlushVertexArray(device, vertexCount, triangleCount);
|
||||
vertexCount = 0;
|
||||
triangleCount = 0;
|
||||
lastTexture = item.texture;
|
||||
device.Textures[0] = lastTexture;
|
||||
if (item.textureLayers != null) {
|
||||
for (int layer = 1; layer < item.textureLayers.Length; ++layer)
|
||||
device.Textures[layer] = item.textureLayers[layer];
|
||||
}
|
||||
}
|
||||
|
||||
int[] itemTriangles = item.triangles;
|
||||
int itemTriangleCount = item.triangleCount;
|
||||
for (int ii = 0, t = triangleCount; ii < itemTriangleCount; ii++, t++)
|
||||
triangles[t] = (short)(itemTriangles[ii] + vertexCount);
|
||||
triangleCount += itemTriangleCount;
|
||||
|
||||
Array.Copy(item.vertices, 0, vertexArray, vertexCount, itemVertexCount);
|
||||
vertexCount += itemVertexCount;
|
||||
}
|
||||
FlushVertexArray(device, vertexCount, triangleCount);
|
||||
}
|
||||
|
||||
public void AfterLastDrawPass () {
|
||||
int itemCount = items.Count;
|
||||
for (int i = 0; i < itemCount; i++) {
|
||||
var item = items[i];
|
||||
item.texture = null;
|
||||
freeItems.Enqueue(item);
|
||||
}
|
||||
items.Clear();
|
||||
}
|
||||
|
||||
private void FlushVertexArray (GraphicsDevice device, int vertexCount, int triangleCount) {
|
||||
if (vertexCount == 0) return;
|
||||
device.DrawUserIndexedPrimitives(
|
||||
PrimitiveType.TriangleList,
|
||||
vertexArray, 0, vertexCount,
|
||||
triangles, 0, triangleCount / 3,
|
||||
VertexPositionColorTextureColor.VertexDeclaration);
|
||||
}
|
||||
}
|
||||
|
||||
public class MeshItem {
|
||||
public Texture2D texture = null;
|
||||
public Texture2D[] textureLayers = null;
|
||||
public int vertexCount, triangleCount;
|
||||
public VertexPositionColorTextureColor[] vertices = { };
|
||||
public int[] triangles = { };
|
||||
}
|
||||
}
|
||||
165
spine-monogame/spine-monogame/src/ShapeRenderer.cs
Normal file
@ -0,0 +1,165 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated September 24, 2021. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2021, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Spine {
|
||||
/// <summary>
|
||||
/// Batch drawing of lines and shapes that can be derived from lines.
|
||||
///
|
||||
/// Call drawing methods in between Begin()/End()
|
||||
/// </summary>
|
||||
public class ShapeRenderer {
|
||||
GraphicsDevice device;
|
||||
List<VertexPositionColor> vertices = new List<VertexPositionColor>();
|
||||
Color color = Color.White;
|
||||
BasicEffect effect;
|
||||
public BasicEffect Effect { get { return effect; } set { effect = value; } }
|
||||
|
||||
public ShapeRenderer (GraphicsDevice device) {
|
||||
this.device = device;
|
||||
this.effect = new BasicEffect(device);
|
||||
effect.World = Matrix.Identity;
|
||||
effect.View = Matrix.CreateLookAt(new Vector3(0.0f, 0.0f, 1.0f), Vector3.Zero, Vector3.Up);
|
||||
effect.TextureEnabled = false;
|
||||
effect.VertexColorEnabled = true;
|
||||
}
|
||||
|
||||
public void SetColor (Color color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public void Begin () {
|
||||
device.RasterizerState = new RasterizerState();
|
||||
device.BlendState = BlendState.AlphaBlend;
|
||||
}
|
||||
|
||||
public void Line (float x1, float y1, float x2, float y2) {
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x1, y1, 0), color));
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x2, y2, 0), color));
|
||||
}
|
||||
|
||||
/** Calls {@link #circle(float, float, float, int)} by estimating the number of segments needed for a smooth circle. */
|
||||
public void Circle (float x, float y, float radius) {
|
||||
Circle(x, y, radius, Math.Max(1, (int)(6 * (float)Math.Pow(radius, 1.0f / 3.0f))));
|
||||
}
|
||||
|
||||
/** Draws a circle using {@link ShapeType#Line} or {@link ShapeType#Filled}. */
|
||||
public void Circle (float x, float y, float radius, int segments) {
|
||||
if (segments <= 0) throw new ArgumentException("segments must be > 0.");
|
||||
float angle = 2 * MathUtils.PI / segments;
|
||||
float cos = MathUtils.Cos(angle);
|
||||
float sin = MathUtils.Sin(angle);
|
||||
float cx = radius, cy = 0;
|
||||
float temp = 0;
|
||||
|
||||
for (int i = 0; i < segments; i++) {
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x + cx, y + cy, 0), color));
|
||||
temp = cx;
|
||||
cx = cos * cx - sin * cy;
|
||||
cy = sin * temp + cos * cy;
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x + cx, y + cy, 0), color));
|
||||
}
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x + cx, y + cy, 0), color));
|
||||
|
||||
temp = cx;
|
||||
cx = radius;
|
||||
cy = 0;
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x + cx, y + cy, 0), color));
|
||||
}
|
||||
|
||||
public void Triangle (float x1, float y1, float x2, float y2, float x3, float y3) {
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x1, y1, 0), color));
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x2, y2, 0), color));
|
||||
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x2, y2, 0), color));
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x3, y3, 0), color));
|
||||
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x3, y3, 0), color));
|
||||
vertices.Add(new VertexPositionColor(new Vector3(x1, y1, 0), color));
|
||||
}
|
||||
|
||||
public void X (float x, float y, float len) {
|
||||
Line(x + len, y + len, x - len, y - len);
|
||||
Line(x - len, y + len, x + len, y - len);
|
||||
}
|
||||
|
||||
public void Polygon (float[] polygonVertices, int offset, int count) {
|
||||
if (count < 3) throw new ArgumentException("Polygon must contain at least 3 vertices");
|
||||
|
||||
offset <<= 1;
|
||||
|
||||
var firstX = polygonVertices[offset];
|
||||
var firstY = polygonVertices[offset + 1];
|
||||
var last = offset + count;
|
||||
|
||||
for (int i = offset, n = offset + count; i < n; i += 2) {
|
||||
var x1 = polygonVertices[i];
|
||||
var y1 = polygonVertices[i + 1];
|
||||
|
||||
var x2 = 0f;
|
||||
var y2 = 0f;
|
||||
|
||||
if (i + 2 >= last) {
|
||||
x2 = firstX;
|
||||
y2 = firstY;
|
||||
} else {
|
||||
x2 = polygonVertices[i + 2];
|
||||
y2 = polygonVertices[i + 3];
|
||||
}
|
||||
|
||||
Line(x1, y1, x2, y2);
|
||||
}
|
||||
}
|
||||
|
||||
public void Rect (float x, float y, float width, float height) {
|
||||
Line(x, y, x + width, y);
|
||||
Line(x + width, y, x + width, y + height);
|
||||
Line(x + width, y + height, x, y + height);
|
||||
Line(x, y + height, x, y);
|
||||
}
|
||||
|
||||
public void End () {
|
||||
if (vertices.Count == 0) return;
|
||||
var verticesArray = vertices.ToArray();
|
||||
|
||||
foreach (EffectPass pass in effect.CurrentTechnique.Passes) {
|
||||
pass.Apply();
|
||||
device.DrawUserPrimitives(PrimitiveType.LineList, verticesArray, 0, verticesArray.Length / 2);
|
||||
}
|
||||
|
||||
vertices.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
228
spine-monogame/spine-monogame/src/SkeletonDebugRenderer.cs
Normal file
@ -0,0 +1,228 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated September 24, 2021. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2021, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Spine {
|
||||
public class SkeletonDebugRenderer {
|
||||
ShapeRenderer renderer;
|
||||
|
||||
public static Color boneLineColor = new Color(1f, 0f, 0f, 1f);
|
||||
public static Color boneOriginColor = new Color(0f, 1f, 0f, 1f);
|
||||
public static Color attachmentLineColor = new Color(0f, 0f, 1f, 0.5f);
|
||||
public static Color triangleLineColor = new Color(1f, 0.64f, 0f, 0.5f);
|
||||
public static Color pathColor = new Color(1f, 0.5f, 0f, 1f);
|
||||
public static Color clipColor = new Color(0.8f, 0f, 0f, 1f);
|
||||
public static Color clipDecomposedColor = new Color(0.8f, 0.8f, 0f, 1f);
|
||||
public static Color aabbColor = new Color(0f, 1f, 0f, 0.5f);
|
||||
|
||||
public BasicEffect Effect { get { return renderer.Effect; } set { renderer.Effect = value; } }
|
||||
public bool DrawBones { get; set; }
|
||||
public bool DrawRegionAttachments { get; set; }
|
||||
public bool DrawBoundingBoxes { get; set; }
|
||||
public bool DrawMeshHull { get; set; }
|
||||
public bool DrawMeshTriangles { get; set; }
|
||||
public bool DrawPaths { get; set; }
|
||||
public bool DrawClipping { get; set; }
|
||||
public bool DrawClippingDecomposed { get; set; }
|
||||
public bool DrawSkeletonXY { get; set; }
|
||||
public void DisableAll () {
|
||||
DrawBones = false;
|
||||
DrawRegionAttachments = false;
|
||||
DrawBoundingBoxes = false;
|
||||
DrawMeshHull = false;
|
||||
DrawMeshTriangles = false;
|
||||
DrawPaths = false;
|
||||
DrawClipping = false;
|
||||
DrawSkeletonXY = false;
|
||||
}
|
||||
|
||||
public void EnableAll () {
|
||||
DrawBones = true;
|
||||
DrawRegionAttachments = true;
|
||||
DrawBoundingBoxes = true;
|
||||
DrawMeshHull = true;
|
||||
DrawMeshTriangles = true;
|
||||
DrawPaths = true;
|
||||
DrawClipping = true;
|
||||
DrawSkeletonXY = true;
|
||||
}
|
||||
|
||||
private float[] vertices = new float[1024 * 2];
|
||||
private SkeletonBounds bounds = new SkeletonBounds();
|
||||
private Triangulator triangulator = new Triangulator();
|
||||
|
||||
public SkeletonDebugRenderer (GraphicsDevice device) {
|
||||
renderer = new ShapeRenderer(device);
|
||||
EnableAll();
|
||||
}
|
||||
|
||||
public void Begin () {
|
||||
renderer.Begin();
|
||||
}
|
||||
|
||||
public void Draw (Skeleton skeleton) {
|
||||
var skeletonX = skeleton.X;
|
||||
var skeletonY = skeleton.Y;
|
||||
|
||||
var bones = skeleton.Bones;
|
||||
if (DrawBones) {
|
||||
renderer.SetColor(boneLineColor);
|
||||
for (int i = 0, n = bones.Count; i < n; i++) {
|
||||
var bone = bones.Items[i];
|
||||
if (bone.Parent == null) continue;
|
||||
var x = bone.Data.Length * bone.A + bone.WorldX;
|
||||
var y = bone.Data.Length * bone.C + bone.WorldY;
|
||||
renderer.Line(bone.WorldX, bone.WorldY, x, y);
|
||||
}
|
||||
if (DrawSkeletonXY) renderer.X(skeletonX, skeletonY, 4);
|
||||
}
|
||||
|
||||
if (DrawRegionAttachments) {
|
||||
renderer.SetColor(attachmentLineColor);
|
||||
var slots = skeleton.Slots;
|
||||
for (int i = 0, n = slots.Count; i < n; i++) {
|
||||
var slot = slots.Items[i];
|
||||
var attachment = slot.Attachment;
|
||||
if (attachment is RegionAttachment) {
|
||||
var regionAttachment = (RegionAttachment)attachment;
|
||||
var vertices = this.vertices;
|
||||
regionAttachment.ComputeWorldVertices(slot, vertices, 0, 2);
|
||||
renderer.Line(vertices[0], vertices[1], vertices[2], vertices[3]);
|
||||
renderer.Line(vertices[2], vertices[3], vertices[4], vertices[5]);
|
||||
renderer.Line(vertices[4], vertices[5], vertices[6], vertices[7]);
|
||||
renderer.Line(vertices[6], vertices[7], vertices[0], vertices[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (DrawMeshHull || DrawMeshTriangles) {
|
||||
var slots = skeleton.Slots;
|
||||
for (int i = 0, n = slots.Count; i < n; i++) {
|
||||
var slot = slots.Items[i];
|
||||
var attachment = slot.Attachment;
|
||||
if (!(attachment is MeshAttachment)) continue;
|
||||
var mesh = (MeshAttachment)attachment;
|
||||
var world = vertices = vertices.Length < mesh.WorldVerticesLength ? new float[mesh.WorldVerticesLength] : vertices;
|
||||
mesh.ComputeWorldVertices(slot, 0, mesh.WorldVerticesLength, world, 0, 2);
|
||||
int[] triangles = mesh.Triangles;
|
||||
var hullLength = mesh.HullLength;
|
||||
if (DrawMeshTriangles) {
|
||||
renderer.SetColor(triangleLineColor);
|
||||
for (int ii = 0, nn = triangles.Count(); ii < nn; ii += 3) {
|
||||
int v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2;
|
||||
renderer.Triangle(world[v1], world[v1 + 1], //
|
||||
world[v2], world[v2 + 1], //
|
||||
world[v3], world[v3 + 1] //
|
||||
);
|
||||
}
|
||||
}
|
||||
if (DrawMeshHull && hullLength > 0) {
|
||||
renderer.SetColor(attachmentLineColor);
|
||||
hullLength = (hullLength >> 1) * 2;
|
||||
float lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1];
|
||||
for (int ii = 0, nn = hullLength; ii < nn; ii += 2) {
|
||||
float x = vertices[ii], y = vertices[ii + 1];
|
||||
renderer.Line(x, y, lastX, lastY);
|
||||
lastX = x;
|
||||
lastY = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (DrawBoundingBoxes) {
|
||||
var bounds = this.bounds;
|
||||
bounds.Update(skeleton, true);
|
||||
renderer.SetColor(aabbColor);
|
||||
renderer.Rect(bounds.MinX, bounds.MinY, bounds.Width, bounds.Height);
|
||||
var polygons = bounds.Polygons;
|
||||
var boxes = bounds.BoundingBoxes;
|
||||
for (int i = 0, n = polygons.Count; i < n; i++) {
|
||||
var polygon = polygons.Items[i];
|
||||
renderer.Polygon(polygon.Vertices, 0, polygon.Count);
|
||||
}
|
||||
}
|
||||
|
||||
if (DrawBones) {
|
||||
renderer.SetColor(boneOriginColor);
|
||||
for (int i = 0, n = bones.Count; i < n; i++) {
|
||||
var bone = bones.Items[i];
|
||||
renderer.Circle(bone.WorldX, bone.WorldY, 3);
|
||||
}
|
||||
}
|
||||
|
||||
if (DrawClipping) {
|
||||
var slots = skeleton.Slots;
|
||||
renderer.SetColor(clipColor);
|
||||
for (int i = 0, n = slots.Count; i < n; i++) {
|
||||
var slot = slots.Items[i];
|
||||
var attachment = slot.Attachment;
|
||||
if (!(attachment is ClippingAttachment)) continue;
|
||||
var clip = (ClippingAttachment)attachment;
|
||||
var nn = clip.WorldVerticesLength;
|
||||
var world = vertices = vertices.Length < nn ? new float[nn] : vertices;
|
||||
clip.ComputeWorldVertices(slot, 0, nn, world, 0, 2);
|
||||
ExposedList<float> clippingPolygon = new ExposedList<float>();
|
||||
for (int ii = 0; ii < nn; ii += 2) {
|
||||
var x = world[ii];
|
||||
var y = world[ii + 1];
|
||||
var x2 = world[(ii + 2) % nn];
|
||||
var y2 = world[(ii + 3) % nn];
|
||||
renderer.Line(x, y, x2, y2);
|
||||
clippingPolygon.Add(x);
|
||||
clippingPolygon.Add(y);
|
||||
}
|
||||
|
||||
if (DrawClippingDecomposed) {
|
||||
SkeletonClipping.MakeClockwise(clippingPolygon);
|
||||
var triangles = triangulator.Triangulate(clippingPolygon);
|
||||
var clippingPolygons = triangulator.Decompose(clippingPolygon, triangles);
|
||||
renderer.SetColor(clipDecomposedColor);
|
||||
foreach (var polygon in clippingPolygons) {
|
||||
SkeletonClipping.MakeClockwise(polygon);
|
||||
polygon.Add(polygon.Items[0]);
|
||||
polygon.Add(polygon.Items[1]);
|
||||
renderer.Polygon(polygon.Items, 0, polygon.Count >> 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void End () {
|
||||
renderer.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
226
spine-monogame/spine-monogame/src/SkeletonRenderer.cs
Normal file
@ -0,0 +1,226 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated September 24, 2021. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2021, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Spine {
|
||||
/// <summary>Draws region and mesh attachments.</summary>
|
||||
public class SkeletonRenderer {
|
||||
private const int TL = 0;
|
||||
private const int TR = 1;
|
||||
private const int BL = 2;
|
||||
private const int BR = 3;
|
||||
|
||||
SkeletonClipping clipper = new SkeletonClipping();
|
||||
GraphicsDevice device;
|
||||
MeshBatcher batcher;
|
||||
public MeshBatcher Batcher { get { return batcher; } }
|
||||
RasterizerState rasterizerState;
|
||||
float[] vertices = new float[8];
|
||||
int[] quadTriangles = { 0, 1, 2, 2, 3, 0 };
|
||||
BlendState defaultBlendState;
|
||||
|
||||
Effect effect;
|
||||
public Effect Effect { get { return effect; } set { effect = value; } }
|
||||
public IVertexEffect VertexEffect { get; set; }
|
||||
|
||||
private bool premultipliedAlpha;
|
||||
public bool PremultipliedAlpha { get { return premultipliedAlpha; } set { premultipliedAlpha = value; } }
|
||||
|
||||
/// <summary>Attachments are rendered back to front in the x/y plane by the SkeletonRenderer.
|
||||
/// Each attachment is offset by a customizable z-spacing value on the z-axis to avoid z-fighting
|
||||
/// in shaders with ZWrite enabled. Typical values lie in the range [-0.1, 0].</summary>
|
||||
private float zSpacing = 0.0f;
|
||||
public float ZSpacing { get { return zSpacing; } set { zSpacing = value; } }
|
||||
|
||||
/// <summary>A Z position offset added at each vertex.</summary>
|
||||
private float z = 0.0f;
|
||||
public float Z { get { return z; } set { z = value; } }
|
||||
|
||||
public SkeletonRenderer (GraphicsDevice device) {
|
||||
this.device = device;
|
||||
|
||||
batcher = new MeshBatcher();
|
||||
|
||||
var basicEffect = new BasicEffect(device);
|
||||
basicEffect.World = Matrix.Identity;
|
||||
basicEffect.View = Matrix.CreateLookAt(new Vector3(0.0f, 0.0f, 1.0f), Vector3.Zero, Vector3.Up);
|
||||
basicEffect.TextureEnabled = true;
|
||||
basicEffect.VertexColorEnabled = true;
|
||||
effect = basicEffect;
|
||||
|
||||
rasterizerState = new RasterizerState();
|
||||
rasterizerState.CullMode = CullMode.None;
|
||||
|
||||
Bone.yDown = true;
|
||||
}
|
||||
|
||||
public void Begin () {
|
||||
defaultBlendState = premultipliedAlpha ? BlendState.AlphaBlend : BlendState.NonPremultiplied;
|
||||
|
||||
device.RasterizerState = rasterizerState;
|
||||
device.BlendState = defaultBlendState;
|
||||
}
|
||||
|
||||
public void End () {
|
||||
foreach (EffectPass pass in effect.CurrentTechnique.Passes) {
|
||||
pass.Apply();
|
||||
batcher.Draw(device);
|
||||
}
|
||||
batcher.AfterLastDrawPass();
|
||||
}
|
||||
|
||||
public void Draw (Skeleton skeleton) {
|
||||
var drawOrder = skeleton.DrawOrder;
|
||||
var drawOrderItems = skeleton.DrawOrder.Items;
|
||||
float skeletonR = skeleton.R, skeletonG = skeleton.G, skeletonB = skeleton.B, skeletonA = skeleton.A;
|
||||
Color color = new Color();
|
||||
|
||||
if (VertexEffect != null) VertexEffect.Begin(skeleton);
|
||||
|
||||
for (int i = 0, n = drawOrder.Count; i < n; i++) {
|
||||
Slot slot = drawOrderItems[i];
|
||||
Attachment attachment = slot.Attachment;
|
||||
float attachmentZOffset = z + zSpacing * i;
|
||||
|
||||
float attachmentColorR, attachmentColorG, attachmentColorB, attachmentColorA;
|
||||
object textureObject = null;
|
||||
int verticesCount = 0;
|
||||
float[] vertices = this.vertices;
|
||||
int indicesCount = 0;
|
||||
int[] indices = null;
|
||||
float[] uvs = null;
|
||||
|
||||
if (attachment is RegionAttachment) {
|
||||
RegionAttachment regionAttachment = (RegionAttachment)attachment;
|
||||
attachmentColorR = regionAttachment.R; attachmentColorG = regionAttachment.G; attachmentColorB = regionAttachment.B; attachmentColorA = regionAttachment.A;
|
||||
AtlasRegion region = (AtlasRegion)regionAttachment.Region;
|
||||
textureObject = region.page.rendererObject;
|
||||
verticesCount = 4;
|
||||
regionAttachment.ComputeWorldVertices(slot, vertices, 0, 2);
|
||||
indicesCount = 6;
|
||||
indices = quadTriangles;
|
||||
uvs = regionAttachment.UVs;
|
||||
} else if (attachment is MeshAttachment) {
|
||||
MeshAttachment mesh = (MeshAttachment)attachment;
|
||||
attachmentColorR = mesh.R; attachmentColorG = mesh.G; attachmentColorB = mesh.B; attachmentColorA = mesh.A;
|
||||
AtlasRegion region = (AtlasRegion)mesh.Region;
|
||||
textureObject = region.page.rendererObject;
|
||||
int vertexCount = mesh.WorldVerticesLength;
|
||||
if (vertices.Length < vertexCount) vertices = new float[vertexCount];
|
||||
verticesCount = vertexCount >> 1;
|
||||
mesh.ComputeWorldVertices(slot, vertices);
|
||||
indicesCount = mesh.Triangles.Length;
|
||||
indices = mesh.Triangles;
|
||||
uvs = mesh.UVs;
|
||||
} else if (attachment is ClippingAttachment) {
|
||||
ClippingAttachment clip = (ClippingAttachment)attachment;
|
||||
clipper.ClipStart(slot, clip);
|
||||
continue;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
// set blend state
|
||||
BlendState blend = slot.Data.BlendMode == BlendMode.Additive ? BlendState.Additive : defaultBlendState;
|
||||
if (device.BlendState != blend) {
|
||||
//End();
|
||||
//device.BlendState = blend;
|
||||
}
|
||||
|
||||
// calculate color
|
||||
float a = skeletonA * slot.A * attachmentColorA;
|
||||
if (premultipliedAlpha) {
|
||||
color = new Color(
|
||||
skeletonR * slot.R * attachmentColorR * a,
|
||||
skeletonG * slot.G * attachmentColorG * a,
|
||||
skeletonB * slot.B * attachmentColorB * a, a);
|
||||
} else {
|
||||
color = new Color(
|
||||
skeletonR * slot.R * attachmentColorR,
|
||||
skeletonG * slot.G * attachmentColorG,
|
||||
skeletonB * slot.B * attachmentColorB, a);
|
||||
}
|
||||
|
||||
Color darkColor = new Color();
|
||||
if (slot.HasSecondColor) {
|
||||
if (premultipliedAlpha) {
|
||||
darkColor = new Color(slot.R2 * a, slot.G2 * a, slot.B2 * a);
|
||||
} else {
|
||||
darkColor = new Color(slot.R2 * a, slot.G2 * a, slot.B2 * a);
|
||||
}
|
||||
}
|
||||
darkColor.A = premultipliedAlpha ? (byte)255 : (byte)0;
|
||||
|
||||
// clip
|
||||
if (clipper.IsClipping) {
|
||||
clipper.ClipTriangles(vertices, verticesCount << 1, indices, indicesCount, uvs);
|
||||
vertices = clipper.ClippedVertices.Items;
|
||||
verticesCount = clipper.ClippedVertices.Count >> 1;
|
||||
indices = clipper.ClippedTriangles.Items;
|
||||
indicesCount = clipper.ClippedTriangles.Count;
|
||||
uvs = clipper.ClippedUVs.Items;
|
||||
}
|
||||
|
||||
if (verticesCount == 0 || indicesCount == 0)
|
||||
continue;
|
||||
|
||||
// submit to batch
|
||||
MeshItem item = batcher.NextItem(verticesCount, indicesCount);
|
||||
if (textureObject is Texture2D)
|
||||
item.texture = (Texture2D)textureObject;
|
||||
else {
|
||||
item.textureLayers = (Texture2D[])textureObject;
|
||||
item.texture = item.textureLayers[0];
|
||||
}
|
||||
for (int ii = 0, nn = indicesCount; ii < nn; ii++) {
|
||||
item.triangles[ii] = indices[ii];
|
||||
}
|
||||
VertexPositionColorTextureColor[] itemVertices = item.vertices;
|
||||
for (int ii = 0, v = 0, nn = verticesCount << 1; v < nn; ii++, v += 2) {
|
||||
itemVertices[ii].Color = color;
|
||||
itemVertices[ii].Color2 = darkColor;
|
||||
itemVertices[ii].Position.X = vertices[v];
|
||||
itemVertices[ii].Position.Y = vertices[v + 1];
|
||||
itemVertices[ii].Position.Z = attachmentZOffset;
|
||||
itemVertices[ii].TextureCoordinate.X = uvs[v];
|
||||
itemVertices[ii].TextureCoordinate.Y = uvs[v + 1];
|
||||
if (VertexEffect != null) VertexEffect.Transform(ref itemVertices[ii]);
|
||||
}
|
||||
|
||||
clipper.ClipEnd(slot);
|
||||
}
|
||||
clipper.ClipEnd();
|
||||
if (VertexEffect != null) VertexEffect.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -27,39 +27,53 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("spine-monogame-example")]
|
||||
[assembly: AssemblyProduct("spine-monogame-example")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
#if WINDOWS_STOREAPP
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Storage;
|
||||
#endif
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
namespace Spine {
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("f47bbbe2-ac55-4263-b224-1c8fcef4714b")]
|
||||
static public class Util {
|
||||
#if WINDOWS_STOREAPP
|
||||
private static async Task<Texture2D> LoadFile(GraphicsDevice device, String path) {
|
||||
var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
|
||||
var file = await folder.GetFileAsync(path).AsTask().ConfigureAwait(false);
|
||||
try {
|
||||
return Util.LoadTexture(device, await file.OpenStreamForReadAsync().ConfigureAwait(false));
|
||||
} catch (Exception ex) {
|
||||
throw new Exception("Error reading texture file: " + path, ex);
|
||||
}
|
||||
}
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
static public Texture2D LoadTexture (GraphicsDevice device, String path) {
|
||||
return LoadFile(device, path).Result;
|
||||
}
|
||||
#else
|
||||
static public Texture2D LoadTexture (GraphicsDevice device, String path) {
|
||||
|
||||
#if WINDOWS_PHONE
|
||||
Stream stream = Microsoft.Xna.Framework.TitleContainer.OpenStream(path);
|
||||
using (Stream input = stream) {
|
||||
#else
|
||||
using (Stream input = new FileStream(path, FileMode.Open, FileAccess.Read)) {
|
||||
#endif
|
||||
try {
|
||||
return Util.LoadTexture(device, input);
|
||||
} catch (Exception ex) {
|
||||
throw new Exception("Error reading texture file: " + path, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static public Texture2D LoadTexture (GraphicsDevice device, Stream input) {
|
||||
return Texture2D.FromStream(device, input);
|
||||
}
|
||||
}
|
||||
}
|
||||
97
spine-monogame/spine-monogame/src/VertexEffect.cs
Normal file
@ -0,0 +1,97 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated September 24, 2021. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2021, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Spine {
|
||||
public interface IVertexEffect {
|
||||
void Begin (Skeleton skeleton);
|
||||
void Transform (ref VertexPositionColorTextureColor vertex);
|
||||
void End ();
|
||||
}
|
||||
|
||||
public class JitterEffect : IVertexEffect {
|
||||
public float JitterX { get; set; }
|
||||
public float JitterY { get; set; }
|
||||
|
||||
public JitterEffect (float jitterX, float jitterY) {
|
||||
JitterX = jitterX;
|
||||
JitterY = jitterY;
|
||||
}
|
||||
|
||||
public void Begin (Skeleton skeleton) {
|
||||
}
|
||||
|
||||
public void End () {
|
||||
}
|
||||
|
||||
public void Transform (ref VertexPositionColorTextureColor vertex) {
|
||||
vertex.Position.X += MathUtils.RandomTriangle(-JitterX, JitterY);
|
||||
vertex.Position.Y += MathUtils.RandomTriangle(-JitterX, JitterY);
|
||||
}
|
||||
}
|
||||
|
||||
public class SwirlEffect : IVertexEffect {
|
||||
private float worldX, worldY, angle;
|
||||
|
||||
public float Radius { get; set; }
|
||||
public float Angle { get { return angle; } set { angle = value * MathUtils.DegRad; } }
|
||||
public float CenterX { get; set; }
|
||||
public float CenterY { get; set; }
|
||||
public IInterpolation Interpolation { get; set; }
|
||||
|
||||
public SwirlEffect (float radius) {
|
||||
Radius = radius;
|
||||
Interpolation = IInterpolation.Pow2;
|
||||
}
|
||||
|
||||
public void Begin (Skeleton skeleton) {
|
||||
worldX = skeleton.X + CenterX;
|
||||
worldY = skeleton.Y + CenterY;
|
||||
}
|
||||
|
||||
public void End () {
|
||||
}
|
||||
|
||||
public void Transform (ref VertexPositionColorTextureColor vertex) {
|
||||
float x = vertex.Position.X - worldX;
|
||||
float y = vertex.Position.Y - worldY;
|
||||
float dist = (float)Math.Sqrt(x * x + y * y);
|
||||
if (dist < Radius) {
|
||||
float theta = Interpolation.Apply(0, angle, (Radius - dist) / Radius);
|
||||
float cos = MathUtils.Cos(theta), sin = MathUtils.Sin(theta);
|
||||
vertex.Position.X = cos * x - sin * y + worldX;
|
||||
vertex.Position.Y = sin * x + cos * y + worldY;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
93
spine-monogame/spine-monogame/src/XnaTextureLoader.cs
Normal file
@ -0,0 +1,93 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated September 24, 2021. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2021, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Spine {
|
||||
public class XnaTextureLoader : TextureLoader {
|
||||
GraphicsDevice device;
|
||||
string[] textureLayerSuffixes = null;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="device">The graphics device to be used.</param>
|
||||
/// <param name="loadMultipleTextureLayers">If <c>true</c> multiple textures layers
|
||||
/// (e.g. a diffuse/albedo texture and a normal map) are loaded instead of a single texture.
|
||||
/// Names are constructed based on suffixes added according to the <c>textureSuffixes</c> parameter.</param>
|
||||
/// <param name="textureSuffixes">If <c>loadMultipleTextureLayers</c> is <c>true</c>, the strings of this array
|
||||
/// define the path name suffix of each layer to be loaded. Array size must be equal to the number of layers to be loaded.
|
||||
/// The first array entry is the suffix to be <c>replaced</c> (e.g. "_albedo", or "" for a first layer without a suffix),
|
||||
/// subsequent array entries contain the suffix to replace the first entry with (e.g. "_normals").
|
||||
///
|
||||
/// An example would be:
|
||||
/// <code>new string[] { "", "_normals" }</code> for loading a base diffuse texture named "skeletonname.png" and
|
||||
/// a normalmap named "skeletonname_normals.png".</param>
|
||||
public XnaTextureLoader (GraphicsDevice device, bool loadMultipleTextureLayers = false, string[] textureSuffixes = null) {
|
||||
this.device = device;
|
||||
if (loadMultipleTextureLayers)
|
||||
this.textureLayerSuffixes = textureSuffixes;
|
||||
}
|
||||
|
||||
public void Load (AtlasPage page, String path) {
|
||||
Texture2D texture = Util.LoadTexture(device, path);
|
||||
page.width = texture.Width;
|
||||
page.height = texture.Height;
|
||||
|
||||
if (textureLayerSuffixes == null) {
|
||||
page.rendererObject = texture;
|
||||
} else {
|
||||
Texture2D[] textureLayersArray = new Texture2D[textureLayerSuffixes.Length];
|
||||
textureLayersArray[0] = texture;
|
||||
for (int layer = 1; layer < textureLayersArray.Length; ++layer) {
|
||||
string layerPath = GetLayerName(path, textureLayerSuffixes[0], textureLayerSuffixes[layer]);
|
||||
textureLayersArray[layer] = Util.LoadTexture(device, layerPath);
|
||||
}
|
||||
page.rendererObject = textureLayersArray;
|
||||
}
|
||||
}
|
||||
|
||||
public void Unload (Object texture) {
|
||||
((Texture2D)texture).Dispose();
|
||||
}
|
||||
|
||||
private string GetLayerName (string firstLayerPath, string firstLayerSuffix, string replacementSuffix) {
|
||||
|
||||
int suffixLocation = firstLayerPath.LastIndexOf(firstLayerSuffix + ".");
|
||||
if (suffixLocation == -1) {
|
||||
throw new Exception(string.Concat("Error composing texture layer name: first texture layer name '", firstLayerPath,
|
||||
"' does not contain suffix to be replaced: '", firstLayerSuffix, "'"));
|
||||
}
|
||||
return firstLayerPath.Remove(suffixLocation, firstLayerSuffix.Length).Insert(suffixLocation, replacementSuffix);
|
||||
}
|
||||
}
|
||||
}
|
||||