Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an AutoCAD style mouse pointer..

Status
Not open for further replies.

basepointdesignz

Programmer
Jul 23, 2002
566
GB
Hi peeps,

I'm trying to create a mouse pointer that looks very similar to the AutoCAD crosshair. For those who don't know, it is a small cross with a vertical and horizontal continous line through, so no matter where the pointer is the lines through remain unlimited on the page (basically they have no end - excuse my crappy description, hehe)

I can get to grips with creating a new mouse pointer but I'm not too sure on how make the crossing lines seems infinite..

Any ideas on how I can accomplish this?


Cheers,
Paul @ basepoint designz LTD..

basepoint designz LTD
 
Never seen AutoCad so I'm not sure if this is exactly what you're after but this script will follow the mouse position and draw lines to the edges of the stage (set for the default stage size of 550 x 400 but you can change the values to suit yur needs):

Code:
this.onMouseMove = function() {
	this.clear();
	this.lineStyle(1);
	this.moveTo(0, _ymouse);
	this.lineTo(550, _ymouse);
	this.moveTo(_xmouse, 0);
	this.lineTo(_xmouse, 400);
	updateAfterEvent();
};
Mouse.hide();
 
Hi Wangbar, thanks for the code but for some reason I couldn't get it to work, but have since sorted it out.

Thanks anyway m8



Cheers,
Paul @ basepoint designz LTD..

basepoint designz LTD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top