aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/UMenuButton.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-11-18 14:42:34 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-11-18 14:42:34 +0000
commit9975f56cded5f6251d0110238fd97b7ee7ccae31 (patch)
treecf93bba0e884f629dec6f869700468bf86ada68d /src/menu/UMenuButton.pas
parentd36fb79a6e0914a43fe9381c32dfdc4639e9a19e (diff)
downloadusdx-9975f56cded5f6251d0110238fd97b7ee7ccae31.tar.gz
usdx-9975f56cded5f6251d0110238fd97b7ee7ccae31.tar.xz
usdx-9975f56cded5f6251d0110238fd97b7ee7ccae31.zip
some changes on mousesupport
- you can click on the whole area of a button after fading - options on selects can be changed by clicking on the arrows - fix mouse parsing at the screensong extensions git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1950 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/menu/UMenuButton.pas')
-rw-r--r--src/menu/UMenuButton.pas48
1 files changed, 47 insertions, 1 deletions
diff --git a/src/menu/UMenuButton.pas b/src/menu/UMenuButton.pas
index 923f0b14..868a86f3 100644
--- a/src/menu/UMenuButton.pas
+++ b/src/menu/UMenuButton.pas
@@ -38,7 +38,8 @@ uses
UTexture,
gl,
UMenuText,
- SDL;
+ SDL,
+ UMenuInteract;
type
CButton = class of TButton;
@@ -116,6 +117,8 @@ type
constructor Create(Textura: TTexture); overload;
constructor Create(Textura, DSTexture: TTexture); overload;
destructor Destroy; override;
+
+ function GetMouseOverArea: TMouseOverRect;
end;
implementation
@@ -529,6 +532,49 @@ begin
end;
end;
+function TButton.GetMouseOverArea: TMouseOverRect;
+begin
+ if (FadeTex.TexNum = 0) then
+ begin
+ Result.X := Texture.X;
+ Result.Y := Texture.Y;
+ Result.W := Texture.W;
+ Result.H := Texture.H;
+ end
+ else
+ begin
+ case FadeTexPos of
+ 0: begin // fade tex on top
+ Result.X := Texture.X;
+ Result.Y := FadeTex.Y;
+ Result.W := Texture.W;
+ Result.H := FadeTex.H + Texture.H;
+ end;
+
+ 1: begin // fade tex on left side
+ Result.X := FadeTex.X;
+ Result.Y := Texture.Y;
+ Result.W := FadeTex.W + Texture.W;
+ Result.H := Texture.H;
+ end;
+
+ 2: begin // fade tex on bottom
+ Result.X := Texture.X;
+ Result.Y := Texture.Y;
+ Result.W := Texture.W;
+ Result.H := FadeTex.H + Texture.H;
+ end;
+
+ 3: begin // fade tex on right side
+ Result.X := Texture.X;
+ Result.Y := Texture.Y;
+ Result.W := FadeTex.W + Texture.W;
+ Result.H := Texture.H;
+ end;
+ end;
+ end;
+end;
+
destructor TButton.Destroy;
begin