From e06c097dbfbebee3c03bf82cdcd05805f546a61d Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 27 Aug 2008 15:01:16 +0000 Subject: rename Menu part2 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1310 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/menu/UMenuStatic.pas | 85 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 src/menu/UMenuStatic.pas (limited to 'src/menu/UMenuStatic.pas') diff --git a/src/menu/UMenuStatic.pas b/src/menu/UMenuStatic.pas new file mode 100644 index 00000000..ac8fa2dc --- /dev/null +++ b/src/menu/UMenuStatic.pas @@ -0,0 +1,85 @@ +unit UMenuStatic; + +interface + +{$I switches.inc} + +uses UTexture, gl; + +type + TStatic = class + public + Texture: TTexture; // Button Screen position and size + Visible: boolean; + + //Reflection Mod + Reflection: boolean; + Reflectionspacing: Real; + + procedure Draw; + constructor Create(Textura: TTexture); overload; + end; + +implementation +uses UDrawTexture; + +procedure TStatic.Draw; +begin + if Visible then + begin + 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); + glEnable(GL_DEPTH_TEST); + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + 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, 0.5*TexH+TexY1); + glVertex3f(x, y+h*scaleH + h*scaleH/2 + Reflectionspacing, z); + + + //Bottom Right + glColor4f(ColR * Int, ColG * Int, ColB * Int, 0); + glTexCoord2f(TexX2*TexW, 0.5*TexH+TexY1); + 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; + + glDisable(GL_TEXTURE_2D); + glDisable(GL_DEPTH_TEST); + glDisable(GL_BLEND); + end; + end; + end; +end; + +constructor TStatic.Create(Textura: TTexture); +begin + inherited Create; + Texture := Textura; +end; + +end. -- cgit v1.2.3 From 1ef212ba89e50965b6b3b2d756be2c17e110b3ee Mon Sep 17 00:00:00 2001 From: tobigun Date: Sat, 6 Sep 2008 09:53:53 +0000 Subject: Delphi-mode set for FPC git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1348 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/menu/UMenuStatic.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/menu/UMenuStatic.pas') diff --git a/src/menu/UMenuStatic.pas b/src/menu/UMenuStatic.pas index ac8fa2dc..93ee9fa6 100644 --- a/src/menu/UMenuStatic.pas +++ b/src/menu/UMenuStatic.pas @@ -2,9 +2,15 @@ unit UMenuStatic; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + {$I switches.inc} -uses UTexture, gl; +uses + UTexture, + gl; type TStatic = class -- cgit v1.2.3 From dbf39d5bfc56c24a67d481187c619dc84828221f Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 23 Sep 2008 21:17:22 +0000 Subject: gpl header added and property svn:header set to "HeadURL Id" git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1403 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/menu/UMenuStatic.pas | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/menu/UMenuStatic.pas') diff --git a/src/menu/UMenuStatic.pas b/src/menu/UMenuStatic.pas index 93ee9fa6..9a10fade 100644 --- a/src/menu/UMenuStatic.pas +++ b/src/menu/UMenuStatic.pas @@ -1,3 +1,28 @@ +{* UltraStar Deluxe - Karaoke Game + * + * UltraStar Deluxe is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + *} + unit UMenuStatic; interface -- cgit v1.2.3 From 13bff3dc29108cde5ec88d6e9ce656ce377b4694 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Fri, 24 Apr 2009 18:43:12 +0000 Subject: cosmetics. No code change git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1692 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/menu/UMenuStatic.pas | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/menu/UMenuStatic.pas') diff --git a/src/menu/UMenuStatic.pas b/src/menu/UMenuStatic.pas index 9a10fade..72f4eb36 100644 --- a/src/menu/UMenuStatic.pas +++ b/src/menu/UMenuStatic.pas @@ -40,19 +40,20 @@ uses type TStatic = class public - Texture: TTexture; // Button Screen position and size - Visible: boolean; + Texture: TTexture; // Button Screen position and size + Visible: boolean; //Reflection Mod - Reflection: boolean; - Reflectionspacing: Real; + Reflection: boolean; + Reflectionspacing: real; procedure Draw; constructor Create(Textura: TTexture); overload; end; implementation -uses UDrawTexture; +uses + UDrawTexture; procedure TStatic.Draw; begin -- cgit v1.2.3