From 23e6a15c7fec4f23cb0f068d909bdba26a62e5d0 Mon Sep 17 00:00:00 2001 From: Tleety Date: Fri, 11 Mar 2016 11:31:53 +0100 Subject: [PATCH] Fixed the fill on sprites, added some config button components, started work on option menu --- .../Schema/Components/ConfigBtnFloat.xml | 6 + .../Schema/Components/ConfigBtnFloat.xsd | 22 ++ .../Schema/Components/ConfigBtnResolution.xml | 6 + .../Schema/Components/ConfigBtnResolution.xsd | 17 ++ resources/Schema/Entities/OptionMenu.xml | 111 +++++++++ resources/Schema/Entities/StartMenu.xml | 223 +++++++++--------- resources/Shaders/Sprite.frag.glsl | 5 +- 7 files changed, 283 insertions(+), 107 deletions(-) create mode 100644 resources/Schema/Components/ConfigBtnFloat.xml create mode 100644 resources/Schema/Components/ConfigBtnFloat.xsd create mode 100644 resources/Schema/Components/ConfigBtnResolution.xml create mode 100644 resources/Schema/Components/ConfigBtnResolution.xsd create mode 100644 resources/Schema/Entities/OptionMenu.xml diff --git a/resources/Schema/Components/ConfigBtnFloat.xml b/resources/Schema/Components/ConfigBtnFloat.xml new file mode 100644 index 00000000..f9d4478e --- /dev/null +++ b/resources/Schema/Components/ConfigBtnFloat.xml @@ -0,0 +1,6 @@ + + +
+ + +
\ No newline at end of file diff --git a/resources/Schema/Components/ConfigBtnFloat.xsd b/resources/Schema/Components/ConfigBtnFloat.xsd new file mode 100644 index 00000000..69b36bd2 --- /dev/null +++ b/resources/Schema/Components/ConfigBtnFloat.xsd @@ -0,0 +1,22 @@ + + + + + + + Used with a Button component, this button will change a variable in the config file. + + + + The header of the section in config. + + + The name of the field to be changed in the config. + + + The value to give the field. + + + + + \ No newline at end of file diff --git a/resources/Schema/Components/ConfigBtnResolution.xml b/resources/Schema/Components/ConfigBtnResolution.xml new file mode 100644 index 00000000..9a586518 --- /dev/null +++ b/resources/Schema/Components/ConfigBtnResolution.xml @@ -0,0 +1,6 @@ + + +
+ + +
\ No newline at end of file diff --git a/resources/Schema/Components/ConfigBtnResolution.xsd b/resources/Schema/Components/ConfigBtnResolution.xsd new file mode 100644 index 00000000..d5d6b723 --- /dev/null +++ b/resources/Schema/Components/ConfigBtnResolution.xsd @@ -0,0 +1,17 @@ + + + + + Used with a Button component, this button will change a variable in the config file. + + + + Value of the resolution width. + + + Value of the resolution height. + + + + + \ No newline at end of file diff --git a/resources/Schema/Entities/OptionMenu.xml b/resources/Schema/Entities/OptionMenu.xml new file mode 100644 index 00000000..21e93530 --- /dev/null +++ b/resources/Schema/Entities/OptionMenu.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + Models/Core/UnitQuad.mesh + + Textures/Core/White.png + + + + + + + + + + + 1920x1080 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + + + + Models/Core/UnitQuad.mesh + + Textures/Core/White.png + true + + + + + + + + + + + + + + + + + Options + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + Models/Core/UnitQuad.mesh + + Textures/Core/White.png + + + + + + + + + + + + + + + diff --git a/resources/Schema/Entities/StartMenu.xml b/resources/Schema/Entities/StartMenu.xml index 02e99d03..86ee626e 100644 --- a/resources/Schema/Entities/StartMenu.xml +++ b/resources/Schema/Entities/StartMenu.xml @@ -22,7 +22,7 @@ - 4.7191051568560454 + 0.53338721940212963 @@ -2828,7 +2828,7 @@ - + @@ -2870,7 +2870,7 @@ - + @@ -2912,7 +2912,7 @@ - + @@ -2954,7 +2954,7 @@ - + @@ -2996,7 +2996,7 @@ - + @@ -3038,7 +3038,7 @@ - + @@ -3080,7 +3080,7 @@ - + @@ -3122,7 +3122,7 @@ - + @@ -3164,7 +3164,7 @@ - + @@ -5261,7 +5261,7 @@ - + @@ -5303,7 +5303,7 @@ - + @@ -6869,7 +6869,7 @@ - + @@ -6911,7 +6911,7 @@ - + @@ -6953,7 +6953,7 @@ - + @@ -6995,7 +6995,7 @@ - + @@ -7037,7 +7037,7 @@ - + @@ -7079,7 +7079,7 @@ - + @@ -7121,7 +7121,7 @@ - + @@ -8796,7 +8796,7 @@ - + @@ -8808,7 +8808,7 @@ - + @@ -8854,44 +8854,6 @@ - - - - - - - - - Models/Core/UnitQuad.mesh - - Textures/HUD/ButtonCorner_16.png - false - - - - - - - - - - - - Models/Core/UnitQuad.mesh - - Textures/HUD/ButtonCorner_16.png - false - - - - - - - - - - - @@ -8913,6 +8875,44 @@ + + + + + + + + + Models/Core/UnitQuad.mesh + + Textures/HUD/ButtonCorner_16.png + false + + + + + + + + + + + + + Models/Core/UnitQuad.mesh + + Textures/HUD/ButtonCorner_16.png + false + + + + + + + + + + @@ -8976,6 +8976,21 @@ + + + + Models/Core/UnitQuad.mesh + + Textures/HUD/ButtonCorner_16.png + false + + + + + + + + @@ -8992,21 +9007,6 @@ - - - - Models/Core/UnitQuad.mesh - - Textures/HUD/ButtonCorner_16.png - false - - - - - - - - @@ -9023,21 +9023,6 @@ - - - - Models/Core/UnitQuad.mesh - - Textures/HUD/ButtonCorner_16.png - false - - - - - - - - @@ -9054,6 +9039,21 @@ + + + + Models/Core/UnitQuad.mesh + + Textures/HUD/ButtonCorner_16.png + false + + + + + + + + @@ -9067,6 +9067,10 @@ true + + Options + 1 + @@ -9076,7 +9080,7 @@ - Option + Options Fonts/DroidSans.ttf,64 @@ -9136,6 +9140,21 @@ + + + + Models/Core/UnitQuad.mesh + + Textures/HUD/ButtonCorner_16.png + false + + + + + + + + @@ -9152,21 +9171,6 @@ - - - - Models/Core/UnitQuad.mesh - - Textures/HUD/ButtonCorner_16.png - false - - - - - - - - @@ -9189,6 +9193,15 @@ + + + + Schema/Entities/OptionMenu.xml + + + + + diff --git a/resources/Shaders/Sprite.frag.glsl b/resources/Shaders/Sprite.frag.glsl index 5b6567eb..eeb2bd2d 100644 --- a/resources/Shaders/Sprite.frag.glsl +++ b/resources/Shaders/Sprite.frag.glsl @@ -29,9 +29,10 @@ void main() vec4 color_result = Color * diffuseTexel; float pos = ((P * vec4(Input.Position, 1)).y + 1.0)/2.0; - float fillResult = floor(pos*FillPercentage); - color_result = FillColor*diffuseTexel.a*fillResult + color_result*(1-fillResult); + if(pos <= FillPercentage) { + color_result = FillColor*diffuseTexel.a; + } sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));