Re: Mouse cursor
- Posted by Jacques Deschenes <desja at QUEBECTEL.COM> Jun 09, 1997
- 915 views
At 18:01 97-06-09 -0600, you wrote: >---------------------- Information from the mail header ----------------------- >Sender: Euphoria Programming for MS-DOS <EUPHORIA at >MIAMIU.ACS.MUOHIO.EDU> >Poster: William Eiten <atompunk at ROF.NET> >Subject: Mouse cursor >------------------------------------------------------------------------------- > >> Here's my question: >> >> Does anyone know how to change the shape and the size of the mouse in >> 320*200 mode (or mode 19). I do no understant mousecur.e > >I have had the same question for a little while. I have seen some examples >in QBasic, but haven't been able to convert them. Thank you for any >replies. > >William > ------------------------- demo ----------------------------------------- -- changing mouse cursor in graphics_mode 19 include image.e include mouse.e include mousecur.e atom junk junk = graphics_mode(19) bk_color(BLUE) clear_screen() puts(1,"move mouse pointer to change shape.\n") for i = 1 to 9 do draw_line(WHITE,{{i*32,0},{i*32,199}}) end for for i = 1 to 2 do draw_line(WHITE,{{0,i*70},{319,i*70}}) end for mouse_pointer(1) object mouse integer x,y,n while 1 do if get_key() = 27 then exit end if mouse = get_mouse() if sequence(mouse) then x = mouse[2] y = mouse[3] n = floor(y/70)*10+floor(x/64) + 1 --note x/64 not x/32 if n > 27 then n = 27 end if Change_cursor(n) end if end while junk = graphics_mode(-1) ----- end of code ----------------------------- if the question was how to design your own cursor shape I'll explain you the structure of the sequence use by mousecur.e mouse_cursor = {{},x,y} mouse_cursor[1] = 64 bytes (32 screen mask, 32 cursor mask) mouse_cursor[2] = hot spot x coord. mouse_cursor[3] = hot sport y coord. a mouse cursor is made of a screen mask , a cursor mask and a hot spot. cursor are 16 by 16 bits array. so the first 32 bytes are the screen mask, the next 32 bytes are the cursor mask and the last 2 number are the coordinates (x,y) of the hot spot. The hot spot is the active point when you click over something. truth table screen mask cursor mask screen result bit bit bit ----------------------------------------------------- 0 0 0 0 1 1 1 0 unchanged 1 1 inverted here an example: ARROW screen mask ---------------- 1001111111111111 #9F,#FF, 1000111111111111 #8F,#FF, 1000011111111111 #87,#FF, 1000001111111111 #83,#FF, 1000000111111111 #81,#FF, 1000000011111111 #80,#FF, 1000000001111111 #80,#7F, 1000000000111111 #80,#3F, 1000000000011111 #80,#1F 1000000000001111 #80,#0F, 1000000011111111 #80,#FF, 1000100011111111 #88,#FF, 1001100001111111 #98,#7F, 1111110000111111 #FC,#3F, 1111110000111111 #FC,#3F, 1111111000111111 #FE,#3F, cursor mask ---------------- 0000000000000000 #00,#00, 0010000000000000 #20,#00, 0011000000000000 #30,#00, 0011100000000000 #38,#00, 0011110000000000 #3C,#00, 0011111000000000 #3E,#00, 0011111100000000 #3F,#00, 0011111110000000 #3F,#80, 0011111111000000 #3F,#C0, 0011111000000000 #3E,#00, 0011011000000000 #33,#00, 0010001100000000 #23,#00, 0000001100000000 #03,#00, 0000000110000000 #01,#80, 0000000110000000 #01,#80, 0000000000000000 #00,#00 hot spot x = 1 hot spot y = 0 Jacques Deschenes Baie-Comeau, Quebec Canada desja at quebectel.com