-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboutonclic.pas
More file actions
40 lines (32 loc) · 1.05 KB
/
boutonclic.pas
File metadata and controls
40 lines (32 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
unit BoutonClic;
{$mode ObjFPC}{$H+}
interface
uses
Classes, Sysutils,raylib;
const
ButtonWidth = 200; //bouton sauvegarde
ButtonHeight = 50;
type
TButtonAxel = record
Rect: TRectangle; // Rectangle du bouton
NormalColor: TColor; // Couleur normale
HoverColor: TColor; // Couleur lorsqu'on passe la souris dessus
ClickedColor: TColor; // Couleur lorsqu'on clique
IsClicked: Boolean; // Indicateur de clic
end;
var
ButtonSave: TButtonAxel;
MousePosition: TVector2;
ColorToUse:TColor;
function CreateButton(X, Y, Width, Height: Single; NormalColor, HoverColor, ClickedColor: TColor): TButtonAxel;
implementation
// Fonction pour créer un bouton
function CreateButton(X, Y, Width, Height: Single; NormalColor, HoverColor, ClickedColor: TColor): TButtonAxel;
begin
Result.Rect := RectangleCreate(X, Y, Width, Height);
Result.NormalColor := NormalColor;
Result.HoverColor := HoverColor;
Result.ClickedColor := ClickedColor;
Result.IsClicked := False;
end;
end.