Skip to content

Commit 4bc69e6

Browse files
committed
Update v2.4
1 parent 37b4b74 commit 4bc69e6

83 files changed

Lines changed: 977 additions & 199 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BasicUI_CocosSharp/BasicUI_CocosSharp/BasicUI_CocosSharp.csproj

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,20 @@
8888
<HintPath>..\packages\CocosSharp.PCL.Shared.1.6.2.0\lib\net40\CocosSharp.dll</HintPath>
8989
<Private>True</Private>
9090
</Reference>
91-
<Reference Include="EmptyKeys.UserInterface, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
92-
<HintPath>..\packages\EmptyKeysUI_CocosSharp.2.3.0.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\Common\AnyCPU\EmptyKeys.UserInterface.dll</HintPath>
91+
<Reference Include="EmptyKeys.UserInterface, Version=2.4.0.0, Culture=neutral, processorArchitecture=MSIL">
92+
<HintPath>..\packages\EmptyKeysUI_CocosSharp.2.4.0.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\Common\AnyCPU\EmptyKeys.UserInterface.dll</HintPath>
9393
<Private>True</Private>
9494
</Reference>
95-
<Reference Include="EmptyKeys.UserInterface.CocosSharp, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
96-
<HintPath>..\packages\EmptyKeysUI_CocosSharp.2.3.0.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\CocosSharp\AnyCPU\EmptyKeys.UserInterface.CocosSharp.dll</HintPath>
95+
<Reference Include="EmptyKeys.UserInterface.CocosSharp, Version=2.4.0.0, Culture=neutral, processorArchitecture=MSIL">
96+
<HintPath>..\packages\EmptyKeysUI_CocosSharp.2.4.0.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\CocosSharp\AnyCPU\EmptyKeys.UserInterface.CocosSharp.dll</HintPath>
9797
<Private>True</Private>
9898
</Reference>
99-
<Reference Include="EmptyKeys.UserInterface.Core, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
100-
<HintPath>..\packages\EmptyKeysUI_CocosSharp.2.3.0.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\Common\AnyCPU\EmptyKeys.UserInterface.Core.dll</HintPath>
99+
<Reference Include="EmptyKeys.UserInterface.Core, Version=2.4.0.0, Culture=neutral, processorArchitecture=MSIL">
100+
<HintPath>..\packages\EmptyKeysUI_CocosSharp.2.4.0.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\Common\AnyCPU\EmptyKeys.UserInterface.Core.dll</HintPath>
101101
<Private>True</Private>
102102
</Reference>
103-
<Reference Include="EmptyKeys.UserInterface.Debug, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
104-
<HintPath>..\packages\EmptyKeysUI_CocosSharp.2.3.0.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\Common\AnyCPU\EmptyKeys.UserInterface.Debug.dll</HintPath>
103+
<Reference Include="EmptyKeys.UserInterface.Debug, Version=2.4.0.0, Culture=neutral, processorArchitecture=MSIL">
104+
<HintPath>..\packages\EmptyKeysUI_CocosSharp.2.4.0.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\Common\AnyCPU\EmptyKeys.UserInterface.Debug.dll</HintPath>
105105
<Private>True</Private>
106106
</Reference>
107107
<Reference Include="Lidgren.Network, Version=2012.1.7.0, Culture=neutral, processorArchitecture=MSIL">
@@ -159,6 +159,7 @@
159159
<Content Include="BehaviorsLicense.txt" />
160160
<Content Include="Game.ico" />
161161
<Content Include="license.txt" />
162+
<Content Include="shaders\DirectionalBlurShader.fx" />
162163
</ItemGroup>
163164
<ItemGroup>
164165
<Content Include="..\Content\bin\Windows\Images\EmptyKeysLogoTextSmall.xnb">
@@ -193,6 +194,10 @@
193194
<Link>Content\sounds\Select.xnb</Link>
194195
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
195196
</Content>
197+
<Content Include="..\Content\bin\Windows\DirectionalBlurShader.xnb">
198+
<Link>Content\DirectionalBlurShader.xnb</Link>
199+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
200+
</Content>
196201
<None Include="app.config" />
197202
<None Include="packages.config">
198203
<SubType>Designer</SubType>

BasicUI_CocosSharp/BasicUI_CocosSharp/GeneratedUI/BasicUI.xaml.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ namespace EmptyKeys.UserInterface.Generated {
1616
using EmptyKeys.UserInterface.Interactions.Core;
1717
using EmptyKeys.UserInterface.Interactivity;
1818
using EmptyKeys.UserInterface.Media;
19+
using EmptyKeys.UserInterface.Media.Effects;
1920
using EmptyKeys.UserInterface.Media.Animation;
2021
using EmptyKeys.UserInterface.Media.Imaging;
2122
using EmptyKeys.UserInterface.Shapes;
2223
using EmptyKeys.UserInterface.Renderers;
2324
using EmptyKeys.UserInterface.Themes;
2425

2526

26-
[GeneratedCodeAttribute("Empty Keys UI Generator", "2.3.0.0")]
27+
[GeneratedCodeAttribute("Empty Keys UI Generator", "2.4.0.0")]
2728
public partial class BasicUI : UIRoot {
2829

2930
private Grid e_0;
@@ -125,6 +126,10 @@ private void InitializeComponent() {
125126
this.e_1.Children.Add(this.logo);
126127
this.logo.Name = "logo";
127128
this.logo.HorizontalAlignment = HorizontalAlignment.Center;
129+
DirectionalBlurEffect logo_dbef = new DirectionalBlurEffect();
130+
logo_dbef.Angle = 0F;
131+
logo_dbef.BlurAmount = 0.002F;
132+
this.logo.Effect = logo_dbef;
128133
this.logo.Stretch = Stretch.None;
129134
this.logo.SetResourceReference(Image.SourceProperty, "logoEmptyKeys");
130135
// e_2 element

BasicUI_CocosSharp/BasicUI_CocosSharp/GeneratedUI/Dictionary.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ namespace EmptyKeys.UserInterface.Generated {
1616
using EmptyKeys.UserInterface.Interactions.Core;
1717
using EmptyKeys.UserInterface.Interactivity;
1818
using EmptyKeys.UserInterface.Media;
19+
using EmptyKeys.UserInterface.Media.Effects;
1920
using EmptyKeys.UserInterface.Media.Animation;
2021
using EmptyKeys.UserInterface.Media.Imaging;
2122
using EmptyKeys.UserInterface.Shapes;
2223
using EmptyKeys.UserInterface.Renderers;
2324
using EmptyKeys.UserInterface.Themes;
2425

2526

26-
[GeneratedCodeAttribute("Empty Keys UI Generator", "2.3.0.0")]
27+
[GeneratedCodeAttribute("Empty Keys UI Generator", "2.4.0.0")]
2728
public sealed class Dictionary : ResourceDictionary {
2829

2930
private static Dictionary singleton = new Dictionary();

BasicUI_CocosSharp/BasicUI_CocosSharp/IntroLayer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using EmptyKeys.UserInterface.Debug;
66
using EmptyKeys.UserInterface.Generated;
77
using EmptyKeys.UserInterface.Media;
8+
using EmptyKeys.UserInterface.Media.Effects;
89
using Microsoft.Xna.Framework;
910
using Microsoft.Xna.Framework.Content;
1011
using Microsoft.Xna.Framework.Graphics;
@@ -46,6 +47,7 @@ protected override void AddedToScene()
4647
SoundManager.Instance.LoadSounds(content, "sounds");
4748
ImageManager.Instance.LoadImages(content);
4849
FontManager.Instance.LoadFonts(content, "fonts");
50+
EffectManager.Instance.LoadEffects(content);
4951

5052
Schedule(UpdateUI);
5153

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="CocosSharp.PCL.Shared" version="1.6.2.0" targetFramework="net45" />
4-
<package id="EmptyKeysUI_CocosSharp" version="2.3.0.0" targetFramework="net45" />
4+
<package id="EmptyKeysUI_CocosSharp" version="2.4.0.0" targetFramework="net45" />
55
</packages>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#if OPENGL
2+
#define SV_POSITION POSITION
3+
#define VS_SHADERMODEL vs_3_0
4+
#define PS_SHADERMODEL ps_3_0
5+
#else
6+
#define VS_SHADERMODEL vs_4_0_level_9_1
7+
#define PS_SHADERMODEL ps_4_0_level_9_1
8+
#endif
9+
10+
float Angle = 0.0f;
11+
float BlurAmount = 0.0f;
12+
13+
Texture2D SpriteTexture;
14+
15+
sampler2D SpriteTextureSampler = sampler_state
16+
{
17+
Texture = <SpriteTexture>;
18+
};
19+
20+
struct VertexShaderOutput
21+
{
22+
float4 Position : SV_POSITION;
23+
float4 Color : COLOR0;
24+
float2 TextureCoordinates : TEXCOORD0;
25+
};
26+
27+
float4 MainPS(VertexShaderOutput input) : COLOR
28+
{
29+
float4 result = 0;
30+
float samples = 8;
31+
float rad = Angle * 0.0174533f;
32+
float xOffset = cos(rad);
33+
float yOffset = sin(rad);
34+
35+
float2 uv = input.TextureCoordinates;
36+
for (int i = 0; i < samples; i++)
37+
{
38+
uv.x = uv.x - BlurAmount * xOffset;
39+
uv.y = uv.y - BlurAmount * yOffset;
40+
result += tex2D(SpriteTextureSampler, uv);
41+
}
42+
43+
result /= samples;
44+
45+
return result * input.Color;
46+
}
47+
48+
technique SpriteDrawing
49+
{
50+
pass P0
51+
{
52+
PixelShader = compile PS_SHADERMODEL MainPS();
53+
}
54+
};

BasicUI_CocosSharp/Content/Content.mgcb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/processorParam:GenerateMipmaps=False
2222
/processorParam:PremultiplyAlpha=True
2323
/processorParam:ResizeToPowerOfTwo=False
24+
/processorParam:MakeSquare=False
2425
/processorParam:TextureFormat=Color
2526
/build:Images/EmptyKeysLogoTextSmall.png
2627

@@ -66,3 +67,9 @@
6667
/processorParam:Quality=Best
6768
/build:Select.wav
6869

70+
#begin DirectionalBlurShader.fx
71+
/importer:EffectImporter
72+
/processor:EffectProcessor
73+
/processorParam:DebugMode=Auto
74+
/build:DirectionalBlurShader.fx
75+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#if OPENGL
2+
#define SV_POSITION POSITION
3+
#define VS_SHADERMODEL vs_3_0
4+
#define PS_SHADERMODEL ps_3_0
5+
#else
6+
#define VS_SHADERMODEL vs_4_0_level_9_1
7+
#define PS_SHADERMODEL ps_4_0_level_9_1
8+
#endif
9+
10+
float Angle = 0.0f;
11+
float BlurAmount = 0.0f;
12+
13+
Texture2D SpriteTexture;
14+
15+
sampler2D SpriteTextureSampler = sampler_state
16+
{
17+
Texture = <SpriteTexture>;
18+
};
19+
20+
struct VertexShaderOutput
21+
{
22+
float4 Position : SV_POSITION;
23+
float4 Color : COLOR0;
24+
float2 TextureCoordinates : TEXCOORD0;
25+
};
26+
27+
float4 MainPS(VertexShaderOutput input) : COLOR
28+
{
29+
float4 result = 0;
30+
float samples = 8;
31+
float rad = Angle * 0.0174533f;
32+
float xOffset = cos(rad);
33+
float yOffset = sin(rad);
34+
35+
float2 uv = input.TextureCoordinates;
36+
for (int i = 0; i < samples; i++)
37+
{
38+
uv.x = uv.x - BlurAmount * xOffset;
39+
uv.y = uv.y - BlurAmount * yOffset;
40+
result += tex2D(SpriteTextureSampler, uv);
41+
}
42+
43+
result /= samples;
44+
45+
return result * input.Color;
46+
}
47+
48+
technique SpriteDrawing
49+
{
50+
pass P0
51+
{
52+
PixelShader = compile PS_SHADERMODEL MainPS();
53+
}
54+
};
5 Bytes
Binary file not shown.
4 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)