-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWithDrawButton.cs
More file actions
29 lines (29 loc) · 863 Bytes
/
Copy pathWithDrawButton.cs
File metadata and controls
29 lines (29 loc) · 863 Bytes
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
using static SplashKitSDK.SplashKit;
using SplashKitSDK;
using System.Drawing;
public class WithDrawButton : Button
{
private bool _isSelected = false;
public WithDrawButton(string text,float x,float y) : base("WithDraw",x,y)
{
}
public override void Draw(){
if(_isSelected){
FillRectangle(RGBColor(128,128,128), X, Y, Width, Height);
}
base.Draw();
}
public override bool IsClicked(float mousex, float mousey){
if (mousex >= X && mousex <= Width + X && mousey >= Y && mousey <= Y + Height){
if(!_isSelected){
_isSelected = true;
}else{
_isSelected = false;
}
return true;
}
return false;
}
public void Update(){}
public bool IsSelected{get=>_isSelected;set=>_isSelected = value;}
}