Forum

csqc getmousepos

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

csqc getmousepos

Postby scarypajamas » Sun Jul 06, 2008 6:26 pm

I'm trying to use CSQC to make an in-game mouse controlled menu. The problem I have is when I try and get the mouse position with getmousepos() it keeps sending me back to 0,0. I figure quake keeps the mouse at 0,0 while in-game, but I want to be able to move it around.

I can't seem to find a command or figure out how to move the mouse around? Can someone shed some light on this? Do I have to mod the source?

My csqc code for the mouse is:


local vector mouse, msize;

mouse = getmousepos(); //should be letting me move mouse around but it keeps returning me to 0,0!

msize_x = 25;
msize_y = 25;
drawpic(mouse, "gfx/cursor", msize, '1 1 1', 1, 0);

// setwantsmousemove( 0 ); <-- do I need this?
scarypajamas
 
Posts: 5
Joined: Mon May 26, 2008 7:15 pm

Postby GiffE » Sun Jul 06, 2008 7:38 pm

Code: Select all
setwantsmousemove(1);

Activates the Mouse for CSQC
You will need to set it to 1 when u want to turn on your menu.

Code: Select all
setwantsmousemove(0);

Puts it back to normal

-Gif
GiffE
 
Posts: 170
Joined: Sun Oct 08, 2006 3:39 pm
Location: USA, CT


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest