Jump to content

amazing rotating trollface cursor


FearMe

Recommended Posts

otORfpI.png

 

variables;

 

final private public static int mX, mY, angle;
final private public static Image image;

 

 

onstart;

 

useDefaultPaint(false);
try {
   URL url = new URL("https://dl.dropboxusercontent.com/u/45922594/cursor.png");
   image = ImageIO.read(url);
} catch (IOException e) {
}

 

 

onpaint;

 

AffineTransform old = g.getTransform(); // put this after you declare a graphics2d
//////////////
mX = client.getMousePosition().x;
mY = client.getMousePosition().y;
 
g.rotate(Math.toRadians(angle += 4), mX, mY); // put all this at the end
if (angle == 360) angle = 0;
g.drawImage(image, mX-15, mY-11, null);
g.setTransform(old);

 

Edited by FearMe
  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...