Version 2.0 of sigIRC rewritten and remastered for Java. Includes "Modules" which can be enabled/disabled to modify functionality of the program.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sigIRCv2/src/sig/modules/TouhouMother/TouhouMotherButton.java

66 lines
1.4 KiB

package sig.modules.TouhouMother;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import sig.sigIRC;
import sig.modules.TouhouMotherModule;
public class TouhouMotherButton {
protected BufferedImage buttonimg;
protected int x=0;
protected int y=0;
protected TouhouMotherModule module;
public TouhouMotherButton(TouhouMotherModule parentmodule, File filename, int x, int y) {
this.x=x;
this.y=y;
this.module=parentmodule;
try {
buttonimg = ImageIO.read(filename);
} catch (IOException e) {
e.printStackTrace();
}
}
public void run() {
}
public void draw(Graphics g) {
g.drawImage(buttonimg, x, y, null);
}
public void onClickEvent(MouseEvent ev) {
}
public void keyPressEvent(KeyEvent ev) {
}
public void keyReleaseEvent(KeyEvent ev) {
}
public void onMouseWheelEvent(MouseWheelEvent ev) {
}
public void updatePosition(int oldX, int oldY, int newX, int newY) {
int diffx = x - oldX;
int diffy = y - oldY;
x = newX + diffx;
y = newY + diffy;
/*System.out.println("Old: "+oldX+","+oldY);
System.out.println("New: "+newX+","+newY);
System.out.println("Diffs: "+diffx+","+diffy);*/
}
}