public IButton(BufferedImage up, BufferedImage down, BufferedImage hover) { super(Utils.imgsz(up)); this.up = up; this.down = down; this.hover = hover; render(); }
public boolean mousedown(Coord c, int button) { if (button != 1) { return (false); } if (!checkhit(c)) { return (false); } a = true; d = ui.grabmouse(this); depress(); render(); return (true); }
public void mousemove(Coord c) { boolean h = checkhit(c); boolean a = false; if (d != null) { a = h; h = true; } if ((h != this.h) || (a != this.a)) { this.h = h; this.a = a; render(); } }