Peter63 Senior Member
 Joined: 28/07/2017 Location: SwedenPosts: 128 |
| Posted: 03:27pm 08 Mar 2026 |
Copy link to clipboard |
 Print this post |
|
Hello, tenij000 Test this program:
' ' Program: m-sprite.bas ' program to make a mouse sprite. ' Version: 2026-03-08 / Peter63 ' used: PicoMiteHDMI MMBasic USB RP2350A Edition V6.02.01RC2 ' MODE 3 Font 1
' activate mouse cursor (create mouse-sprite file, if missing) On error skip 1 Sprite load "mouse.spr",1,1 If MM.Errno Then Print "Mouse-sprite file created... wait..." make_sprite_mouse ' create mouse cursor Pause 3000 End If Sprite load "mouse.spr",1,1
CLS Color RGB(white),RGB(black) Text 100,0," MOUSE-SPRITE TEST-PROGRAM , ESC=QUIT PROGRAM " Text 100,16," USE LEFT MOUSE BUTTON, AND RIGHT MOUSE BUTTON " xold=-9999:yold=-9999
' -------- MAIN LOOP: START -------- Do
t=Asc(Inkey$)
' get mouse info x=DEVICE(mouse 2,X) y=DEVICE(mouse 2,Y) lm=DEVICE(mouse 2,L) ' left mouse button rm=DEVICE(mouse 2,R) ' right mouse button mm=DEVICE(mouse 2,M) ' middle mouse button dd=DEVICE(mouse 2,D) ' double click of the left mouse button
If xold<>x Or yold<>y Then ' show mouse on screen Sprite show 1,x,y,1 xold=x:yold=y End If
If lm Then ' check if left mouse button is pressed Sprite hide 1 Circle x,y,20,1,1,RGB(red) ' print a circle to screen Sprite show 1,x,y,1 End If
If rm Then ' check if right mouse button is pressed Sprite hide 1 Circle x,y,20,1,1,RGB(black),RGB(black) ' filled black circle Sprite show 1,x,y,1 End If
Loop Until t=27 ' -------- MAIN LOOP: END -------- End
' --- make a sprite mouse file "mouse.spr" --- Sub make_sprite_mouse Open "mouse.spr" As output For #1 Print #1,"16,1" Print #1,"FFFFFF0000000000" Print #1,"FF00000000000000" Print #1,"F0F0000000000000" Print #1,"F00F000000000000" Print #1,"F000F00000000000" Print #1,"F0000F0000000000" Print #1,"000000F000000000" Print #1,"0000000F00000000" Print #1,"00000000F0000000" Print #1,"0000000000000000" Print #1,"0000000000000000" Print #1,"0000000000000000" Print #1,"0000000000000000" Print #1,"0000000000000000" Print #1,"0000000000000000" Print #1,"0000000000000000" Close #1 End Sub
/Peter63 |