----------------------------------- Skizzarz Wed Jan 07, 2004 4:50 pm Crosshair over mouse... ----------------------------------- yo guys im making my summative and i want a crosshair over my mouse...I just cant seem to find how to declare the proper variables for the x and y coordinates of the mouse... heres the code so far: setscreen ("graphics:800;600") setscreen ("nocursor") var x,y,buttonnumber,buttonupdown,buttons:int var nx,ny:int const centerx:= maxx div 2 const centery:= maxy div 2 colorback (2) loop cls colorback (2) drawfilloval (centerx, centery + 10, 5, 5, 66) % Defenders head drawdot (centerx - 2,centery + 12,200) drawdot (centerx + 2,centery + 12, 200) drawline (centerx - 2, centery + 8, centerx + 2, centery + 8, 200) drawfillbox (centerx + 5, centery + 5, centerx - 5, centery - 10, 32) % Defenders shirt drawline (centerx - 15, centery - 7, centerx - 5, centery + 3, 32)% Defenders sleeve drawline (centerx - 17, centery - 5, centerx - 5, centery + 5, 32)% Defenders sleeve drawline (centerx - 16, centery - 6, centerx - 5, centery + 4, 32)% Defenders sleeve drawline (centerx + 15, centery - 7, centerx + 5, centery + 3, 32)% Defenders sleeve drawline (centerx + 17, centery - 5, centerx + 5, centery + 5, 32)% Defenders sleeve drawline (centerx + 16, centery - 6, centerx + 5, centery + 4, 32)% Defenders sleeve drawfillbox (centerx - 5, centery - 11, centerx - 1, centery - 30, 4 )%Defenders pants drawfillbox (centerx + 5, centery - 11, centerx + 1, centery - 30, 4 )%Defenders pants drawfillbox (centerx - 1, centery - 11, centerx + 1, centery - 15, 4 )%Defenders pants drawfilloval (centerx - 4, centery - 30, 3, 2, 200 )%Defenders shoes drawfilloval (centerx + 4, centery - 30, 3, 2, 200 )%Defenders shoes drawfillbox (centerx - 18, centery - 5, centerx - 16, centery - 10, 28)%gun drawfilloval (centerx - 20, centery - 4, 5, 1, 28) %gun drawfilloval (centerx - 26, centery -4, 1, 1, 12)%gun drawfillbox (centerx + 18, centery - 5, centerx + 16, centery - 10, 28)%gun drawfilloval (centerx + 20, centery - 4, 5, 1, 28) %gun drawfilloval (centerx + 26, centery -4, 1, 1, 12)%gun drawfillbox (centerx + 35, centery + 25, centerx + 45, centery + 35, 90) drawfillbox (centerx - 35, centery + 25, centerx - 45, centery + 35, 90) drawfillbox (centerx + 35, centery - 40, centerx + 45, centery - 50, 90) drawfillbox (centerx - 35, centery - 40, centerx - 45, centery - 50, 90) drawfillbox (centerx - 5, centery - 40, centerx + 5, centery - 50, 90) drawfillbox (centerx + 5, centery + 25, centerx - 5, centery + 35, 90) drawfillbox (centerx - 35, centery - 2, centerx - 45, centery - 12, 90) drawfillbox (centerx + 35, centery - 2, centerx + 45, centery - 12, 90) drawfillbox (centerx + 25, centery + 25, centerx + 15, centery + 35, 90) drawfillbox (centerx - 25, centery + 25, centerx - 15, centery + 35, 90) drawfillbox (centerx + 15, centery - 40, centerx + 25, centery - 50, 90) drawfillbox (centerx - 15, centery - 40, centerx - 25, centery - 50, 90) drawfillbox (centerx + 35, centery - 22, centerx + 45, centery - 32, 90) drawfillbox (centerx + 35, centery + 6, centerx + 45, centery + 16, 90) drawfillbox (centerx - 35, centery - 22, centerx - 45, centery - 32, 90) drawfillbox (centerx - 35, centery + 6, centerx - 45, centery + 16, 90) drawbox (centerx + 34, centery + 24, centerx + 44, centery + 34, 6) drawbox (centerx - 34, centery + 24, centerx - 44, centery + 34, 6) drawbox (centerx + 34, centery - 39, centerx + 44, centery - 49, 6) drawbox (centerx - 34, centery - 39, centerx - 44, centery - 49, 6) drawbox (centerx - 4, centery - 39, centerx + 4, centery - 49, 6) drawbox (centerx + 4, centery + 24, centerx - 4, centery + 34, 6) drawbox (centerx - 34, centery - 1, centerx - 44, centery - 11, 6) drawbox (centerx + 34, centery - 1, centerx + 44, centery - 11, 6) drawbox (centerx + 24, centery + 24, centerx + 14, centery + 34, 6) drawbox (centerx - 24, centery + 24, centerx - 14, centery + 34, 6) drawbox (centerx + 14, centery - 39, centerx + 24, centery - 49, 6) drawbox (centerx - 14, centery - 39, centerx - 24, centery - 49, 6) drawbox (centerx + 34, centery - 21, centerx + 44, centery - 31, 6) drawbox (centerx + 34, centery + 5, centerx + 44, centery + 15, 6) drawbox (centerx - 34, centery - 21, centerx - 44, centery - 31, 6) drawbox (centerx - 34, centery + 5, centerx - 44, centery + 15, 6) buttonwait ("down",x,y,buttonnumber,buttonupdown) nx:=x ny:=y var s : int := 1000 loop cls if nx < centerx then drawline (centerx - 26,centery - 4,nx,ny,12) elsif nx > centerx then drawline (centerx + 26,centery - 4,nx,ny,12) end if drawfilloval (centerx, centery + 10, 5, 5, 66) % Defenders head drawdot (centerx - 2,centery + 12,200) drawdot (centerx + 2,centery + 12, 200) drawfilloval (centerx, centery + 8, 3,1,200) drawfillbox (centerx + 5, centery + 5, centerx - 5, centery - 10, 32) % Defenders shirt drawline (centerx - 15, centery - 7, centerx - 5, centery + 3, 32)% Defenders sleeve drawline (centerx - 17, centery - 5, centerx - 5, centery + 5, 32)% Defenders sleeve drawline (centerx - 16, centery - 6, centerx - 5, centery + 4, 32)% Defenders sleeve drawline (centerx + 15, centery - 7, centerx + 5, centery + 3, 32)% Defenders sleeve drawline (centerx + 17, centery - 5, centerx + 5, centery + 5, 32)% Defenders sleeve drawline (centerx + 16, centery - 6, centerx + 5, centery + 4, 32)% Defenders sleeve drawfillbox (centerx - 5, centery - 11, centerx - 1, centery - 30, 4 )%Defenders pants drawfillbox (centerx + 5, centery - 11, centerx + 1, centery - 30, 4 )%Defenders pants drawfillbox (centerx - 1, centery - 11, centerx + 1, centery - 15, 4 )%Defenders pants drawfilloval (centerx - 4, centery - 30, 3, 2, 200 )%Defenders shoes drawfilloval (centerx + 4, centery - 30, 3, 2, 200 )%Defenders shoes drawfillbox (centerx - 18, centery - 5, centerx - 16, centery - 10, 28) drawfilloval (centerx - 20, centery - 4, 5, 1, 28) drawfilloval (centerx - 26, centery -4, 1, 1, 12) drawfillbox (centerx + 18, centery - 5, centerx + 16, centery - 10, 28) drawfilloval (centerx + 20, centery - 4, 5, 1, 28) drawfilloval (centerx + 26, centery -4, 1, 1, 12) drawfillbox (centerx + 35, centery + 25, centerx + 45, centery + 35, 90) drawfillbox (centerx - 35, centery + 25, centerx - 45, centery + 35, 90) drawfillbox (centerx + 35, centery - 40, centerx + 45, centery - 50, 90) drawfillbox (centerx - 35, centery - 40, centerx - 45, centery - 50, 90) drawfillbox (centerx - 5, centery - 40, centerx + 5, centery - 50, 90) drawfillbox (centerx + 5, centery + 25, centerx - 5, centery + 35, 90) drawfillbox (centerx - 35, centery - 2, centerx - 45, centery - 12, 90) drawfillbox (centerx + 35, centery - 2, centerx + 45, centery - 12, 90) drawfillbox (centerx + 25, centery + 25, centerx + 15, centery + 35, 90) drawfillbox (centerx - 25, centery + 25, centerx - 15, centery + 35, 90) drawfillbox (centerx + 15, centery - 40, centerx + 25, centery - 50, 90) drawfillbox (centerx - 15, centery - 40, centerx - 25, centery - 50, 90) drawfillbox (centerx + 35, centery - 22, centerx + 45, centery - 32, 90) drawfillbox (centerx + 35, centery + 6, centerx + 45, centery + 16, 90) drawfillbox (centerx - 35, centery - 22, centerx - 45, centery - 32, 90) drawfillbox (centerx - 35, centery + 6, centerx - 45, centery + 16, 90) drawbox (centerx + 34, centery + 24, centerx + 44, centery + 34, 6) drawbox (centerx - 34, centery + 24, centerx - 44, centery + 34, 6) drawbox (centerx + 34, centery - 39, centerx + 44, centery - 49, 6) drawbox (centerx - 34, centery - 39, centerx - 44, centery - 49, 6) drawbox (centerx - 4, centery - 39, centerx + 4, centery - 49, 6) drawbox (centerx + 4, centery + 24, centerx - 4, centery + 34, 6) drawbox (centerx - 34, centery - 1, centerx - 44, centery - 11, 6) drawbox (centerx + 34, centery - 1, centerx + 44, centery - 11, 6) drawbox (centerx + 24, centery + 24, centerx + 14, centery + 34, 6) drawbox (centerx - 24, centery + 24, centerx - 14, centery + 34, 6) drawbox (centerx + 14, centery - 39, centerx + 24, centery - 49, 6) drawbox (centerx - 14, centery - 39, centerx - 24, centery - 49, 6) drawbox (centerx + 34, centery - 21, centerx + 44, centery - 31, 6) drawbox (centerx + 34, centery + 5, centerx + 44, centery + 15, 6) drawbox (centerx - 34, centery - 21, centerx - 44, centery - 31, 6) drawbox (centerx - 34, centery + 5, centerx - 44, centery + 15, 6) for i : 1..15 sound ( s , 15 ) s := s - 40 end for exit when buttonmoved ("up") mousewhere (nx,ny,buttons) end loop buttonwait ("up", nx,ny,buttonnumber,buttonupdown) end loop ----------------------------------- Thuged_Out_G Wed Jan 07, 2004 6:09 pm ----------------------------------- i did something like this before..let me see if a remember correctly var x,y,button:int loop Mouse.Where(x,y,button) drawoval(x,y,x,y,10) end loop play around with that, instead of drawoval...use w/e you are using for a crosshair, if no one has posted a better solution by the time i get to the other comp, ill post you what i used for a crosshair and how i made it follow the mouse ----------------------------------- Skizzarz Wed Jan 07, 2004 6:10 pm ----------------------------------- thanks man i'll see if i can make it work. ----------------------------------- Thuged_Out_G Wed Jan 07, 2004 6:15 pm ----------------------------------- sorry i cant be of more help, but i dont have turing on this comp lol...so i didnt wanna put alot of effort into, just for it not to work :oops: lol ----------------------------------- Skizzarz Wed Jan 07, 2004 6:22 pm ----------------------------------- well...it works as a separate program but... because its a loop as soon as i get to it in my game... it wont get out of it (because its a cont. loop obviosly) how do i get around this? :? ----------------------------------- Skizzarz Wed Jan 07, 2004 7:54 pm ----------------------------------- please... anyone answer my question.... ----------------------------------- Skizzarz Wed Jan 07, 2004 8:42 pm ----------------------------------- PLEASE SOMEONE POST! ANYONE! IF YOU DONT SOON THIS PUPPY IS GOING TO DIE! DO YOU REALLY WANT HIM TO DIE? lol damnit...i dont know how to insert pics... meh...[img][/img] ----------------------------------- Dan Wed Jan 07, 2004 10:26 pm ----------------------------------- you cant put a pic or draw somting "over" the mouse but you can close on under it. you need to use mousewhere and a code like Thuged_Out_G showed you. ----------------------------------- Skizzarz Thu Jan 08, 2004 12:22 pm ----------------------------------- lol, did u read my post after thuged out g? cuz i already got the cursor goin but i need to know where to put the code so it wil run when my pogram is running.