-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrowButton.java
More file actions
34 lines (31 loc) · 981 Bytes
/
ArrowButton.java
File metadata and controls
34 lines (31 loc) · 981 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
30
31
32
33
34
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* The button for the arrows in the tutorial screen <br>
* The user clicks on this to move the pictures
*
* @author James Lu
* @version 1.0
*/
public class ArrowButton extends SSButtons
{
private boolean next;
public ArrowButton(boolean next){
if (next){ //if this is the left arrow
bg[0] = new GreenfootImage ("Buttons/next1.png");
bg[1] = new GreenfootImage ("Buttons/next2.png");
bg[2] = new GreenfootImage ("Buttons/next3.png");
}else{
bg[0] = new GreenfootImage ("Buttons/prev1.png");
bg[1] = new GreenfootImage ("Buttons/prev2.png");
bg[2] = new GreenfootImage ("Buttons/prev3.png");
}
this.next = next;
this.setImage (bg[0]);
}
/**
* Returns true if this is the right arrow
*/
public boolean isNext(){
return next;
}
}