Jump to content

Crosshair in onPaint(Graphics2D g)?


atoo

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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