Jump to content

Crosshair in onPaint(Graphics2D g)?


Recommended Posts

Posted (edited)

After hours on working on my powerchopper i finally got it to work (thanks everyone who helped me)

But now i just want to add one single thing before im done for today, Is it possible to make an simple chair in onPaint(Graphics2D g) that Will show My mouse

I have googled it but could not seem to find anything.

Edited by atoo
Posted

Have a snippet for a simple cross which I use in my unicows script:

 

aeffbeb263b3af2d1c6046ea2420e8b8.png

	@Override
	public void onPaint(Graphics2D g) {
		g.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING,
				RenderingHints.VALUE_ANTIALIAS_ON)); //anti aliasing		
g.drawLine(script.mouse.getPosition().x - 5,
				script.mouse.getPosition().y + 5,
				script.mouse.getPosition().x + 5,
				script.mouse.getPosition().y - 5); //line 1
		g.drawLine(script.mouse.getPosition().x + 5,
				script.mouse.getPosition().y + 5,
				script.mouse.getPosition().x - 5,
				script.mouse.getPosition().y - 5); //line 2
}

apa

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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