123456789101112131415161718192021222324252627282930 |
- package main.java.com.lotkavolterra;
- public class Bar extends Structs {
- float x; // top left corner x position
- float y; // top left corner y position
- float w; // width of button
- float h; // height of button
- float my_fill; // Fill the box till
- Bar( float xpos, float ypos, float widthB, float heightB) {
- x = xpos;
- y = ypos;
- w = widthB;
- h = heightB;
- my_fill=x;
- }
- double get_value() {
- return my_fill/w;
- }
- boolean MouseIsOver( float mouseX, float mouseY) {
- if (mouseX > x && mouseX < (x + w) && mouseY > y && mouseY < (y + h)) {
- my_fill=mouseX - x;
- return true;
- }
- return false;
- }
- }
|