aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Menu/UMenuStatic.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-13 11:25:13 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-13 11:25:13 +0000
commite6917faa19aebfa6d089b24c65e4c7fe4bd6b503 (patch)
treeb8ba06b150cacf05b39bec363b03436d85b725ce /Game/Code/Menu/UMenuStatic.pas
parent85f1d57678fc6bc3f170d10311ffab90fda1e30c (diff)
downloadusdx-e6917faa19aebfa6d089b24c65e4c7fe4bd6b503.tar.gz
usdx-e6917faa19aebfa6d089b24c65e4c7fe4bd6b503.tar.xz
usdx-e6917faa19aebfa6d089b24c65e4c7fe4bd6b503.zip
Added Reflection to ThemeStatic
Added Attribut ReflectionSpacing git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@83 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Menu/UMenuStatic.pas')
-rw-r--r--Game/Code/Menu/UMenuStatic.pas47
1 files changed, 47 insertions, 0 deletions
diff --git a/Game/Code/Menu/UMenuStatic.pas b/Game/Code/Menu/UMenuStatic.pas
index 4b10e54c..c19e6abc 100644
--- a/Game/Code/Menu/UMenuStatic.pas
+++ b/Game/Code/Menu/UMenuStatic.pas
@@ -8,6 +8,11 @@ type
public
Texture: TTexture; // Button Screen position and size
Visible: boolean;
+
+ //Reflection Mod
+ Reflection: boolean;
+ Reflectionspacing: Real;
+
procedure Draw;
constructor Create(Textura: TTexture); overload;
end;
@@ -21,6 +26,48 @@ var
begin
if Visible then
DrawTexture(Texture);
+
+ //Reflection Mod
+ if (Reflection) then // Draw Reflections
+ begin
+ with Texture do
+ begin
+ //Bind Tex and GL Attributes
+ glEnable(GL_TEXTURE_2D);
+ glEnable(GL_BLEND);
+ glDepthRange(0, 10);
+ glDepthFunc(GL_LEQUAL);
+ //glDepthFunc(GL_GEQUAL);
+ glEnable(GL_DEPTH_TEST);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ //glBlendFunc(GL_SRC_COLOR, GL_ZERO);
+ glBindTexture(GL_TEXTURE_2D, TexNum);
+
+ //Draw
+ glBegin(GL_QUADS);//Top Left
+ glColor4f(ColR * Int, ColG * Int, ColB * Int, Alpha-0.3);
+ glTexCoord2f(TexX1*TexW, TexY2*TexH);
+ glVertex3f(x, y+h*scaleH+ Reflectionspacing, z);
+
+ //Bottom Left
+ glColor4f(ColR * Int, ColG * Int, ColB * Int, 0);
+ glTexCoord2f(TexX1*TexW, {TexY1*TexH*}0.5);
+ glVertex3f(x, y+h*scaleH + h*scaleH/2 + Reflectionspacing, z);
+
+
+ //Bottom Right
+ glColor4f(ColR * Int, ColG * Int, ColB * Int, 0);
+ glTexCoord2f(TexX2*TexW, {TexY1*TexH*}0.5);
+ glVertex3f(x+w*scaleW, y+h*scaleH + h*scaleH/2 + Reflectionspacing, z);
+
+ //Top Right
+ glColor4f(ColR * Int, ColG * Int, ColB * Int, Alpha-0.3);
+ glTexCoord2f(TexX2*TexW, TexY2*TexH);
+ glVertex3f(x+w*scaleW, y+h*scaleH + Reflectionspacing, z);
+ glEnd;
+ end;
+ end;
+
end;
constructor TStatic.Create(Textura: TTexture);