-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoundButton.java
More file actions
executable file
·28 lines (25 loc) · 896 Bytes
/
RoundButton.java
File metadata and controls
executable file
·28 lines (25 loc) · 896 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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class RoundButton here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class RoundButton extends Button {
/**
* Act - do whatever the RoundButton wants to do. This method is called whenever the 'Act' or
* 'Run' button gets pressed in the environment.
*/
boolean ifDiscbetion = true;
private boolean holdState = false;
private GreenfootImage clickedEventButton;
private GreenfootImage unclickedEventButton;
public RoundButton() {
super(true);
clickedEventButton = new GreenfootImage("button/roundButton_pressed.png");
unclickedEventButton = new GreenfootImage("button/roundButton_unpressed.png");
clickedEventButton.scale(216, 100);
unclickedEventButton.scale(216, 100);
setImage(unclickedEventButton);
}
}