News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

MouseWheel

Started by XpMe_v1.2, December 29, 2005, 11:12:04 AM

Previous topic - Next topic

XpMe_v1.2

Just tried the new MouseWheel commands
This works good to show wheel movements

PlayBASIC Code: [Select]
GLOBAL NewWheel , OldWheel
` I set SETFPS to 3 so you can see the text updates
SETFPS 3
DO
Show_MouseWheelUpDownInformation(100,99)
SYNC
LOOP
END
`-------
FUNCTION Show_MouseWheelUpDownInformation(x,y)
NewWheel = MOUSEZ()
IF NewWheel > OldWheel THEN UpDn$ = " Up" : UpDn = 1
IF NewWheel < OldWheel THEN UpDn$ = " Dn" : UpDn = -1
IF NewWheel = OldWheel THEN UpDn$ = "No Move" : UpDn = 0
CLS RGB( 12, 12, 12)
INK RGB(255,220, 20) : TEXT 270,150, UpDn$
INK RGB( 20,255,255) : TEXT 400,150, STR$(UpDn)
OldWheel = NewWheel
INK RGB(220,255,225) : TEXT 400,200, STR$(MOUSEMOVEZ())
ENDFUNCTION




...XpMe v1.2

http://tilemusic.com/

XpMe_v1.2

#1
Added 2 circles that moves up and down  to movements to the mouse wheel.

PlayBASIC Code: [Select]
GLOBAL NewWheel , OldWheel
GLOBAL Wy1 = 300
GLOBAL Wy2 = 300
` I set SETFPS to 3 so you can see the text updates
SETFPS 3
DO
Show_MouseWheelUpDownInformation(100,99)
SYNC
LOOP
END
`-------
FUNCTION Show_MouseWheelUpDownInformation(x,y)
MoveItZ = MOUSEMOVEZ()
NewWheel = MOUSEZ()
IF NewWheel > OldWheel THEN UpDn$ = " Up" : UpDn = 1
IF NewWheel < OldWheel THEN UpDn$ = " Dn" : UpDn = -1
IF NewWheel = OldWheel THEN UpDn$ = "No Move" : UpDn = 0
CLS RGB( 12, 12, 12)
INK RGB(255,220, 20) : TEXT 270,150, UpDn$
INK RGB( 20,255,255) : TEXT 400,150, STR$(UpDn)
OldWheel = NewWheel
INK RGB(220,255,225) : TEXT 400,200, STR$(MoveItZ)
`--- Move 2 circles with the MouseWheel
Wy1 = Wy1 + UpDn * 10 : CIRCLEC 22,Wy1,10,1,RGB( 88, 88,188)
CIRCLEC 22,Wy1, 8,1,RGB(188,188,248)
Wy2 = Wy2 + MoveItZ * 10 : CIRCLEC 66,Wy2,10,1,RGB( 88,188, 88)
CIRCLEC 66,Wy2, 8,1,RGB(188,248,188)
ENDFUNCTION




...XpMe v1.2

http://tilemusic.com/

XpMe_v1.2

#2
Added a scrolling text list box that moves up and down to movements to the mouse wheel.

I can think of a lot of other uses for these 2 commands.
Like sound volume control, changing image brightness and many other things.

PlayBASIC Code: [Select]
DIM Info$(6)
GLOBAL TextStart = 1
FOR t = 1 TO 6 : Info$(t) = READDATA$() : NEXT
DATA "The","Mouse","Wheel","works","for","me."
GLOBAL NewWheel , OldWheel
GLOBAL Wy1 = 300
GLOBAL Wy2 = 300
` I set SETFPS to 3 so you can see the text updates
SETFPS 3
DO
Show_MouseWheelUpDownInformation(100,99)
SYNC
LOOP
END
`-------
FUNCTION Show_MouseWheelUpDownInformation(x,y)
MoveItZ = MOUSEMOVEZ()
NewWheel = MOUSEZ()
IF NewWheel > OldWheel THEN UpDn$ = " Up" : UpDn = 1
IF NewWheel < OldWheel THEN UpDn$ = " Dn" : UpDn = -1
IF NewWheel = OldWheel THEN UpDn$ = "No Move" : UpDn = 0
CLS RGB( 12, 12, 12)
INK RGB(255,220, 20) : TEXT 270,150, UpDn$
INK RGB( 20,255,255) : TEXT 400,150, STR$(UpDn)
OldWheel = NewWheel
INK RGB(220,255,225) : TEXT 400,200, STR$(MoveItZ)
`--- Move 2 circles with the MouseWheel
Wy1 = Wy1 + UpDn * 10 : CIRCLEC 22,Wy1,10,1,RGB( 88, 88,188)
CIRCLEC 22,Wy1, 8,1,RGB(188,188,248)
Wy2 = Wy2 + MoveItZ * 10 : CIRCLEC 66,Wy2,10,1,RGB( 88,188, 88)
CIRCLEC 66,Wy2, 8,1,RGB(188,248,188)
`--- Move TEXT UP and Down with the MouseWheel
INK RGB(255,255,225)
yy = 40
FOR t = 1 TO 6 : BOXC 500,yy , 600,yy+15 ,1,RGB( 99, 99, 99)
BOXC 501,yy+1, 599,yy+14 ,1,RGB(199,199,199)
yy = yy + 15
NEXT
INK RGB(99,2,2)
yy = 40
IF UpDn = -1 THEN TextStart = TextStart - 1
IF UpDn = 1 THEN TextStart = TextStart + 1
IF TextStart < 1 THEN TextStart = 1
IF TextStart > 6 THEN TextStart = 6
FOR t = TextStart TO 6 : TEXT 502,yy, Info$(t)
yy = yy + 15
NEXT
ENDFUNCTION


...XpMe v1.2

http://tilemusic.com/

kevin

Cool, i've finally added something useful  :)

PS.  You might like to use the    [ Code ]  & [/ Code]  box tags in the future

XpMe_v1.2

QuotePS. You might like to use the [ Code ] & [/ Code] box tags in the future
I'll start using it from now on any future posts.
I don't have to work today so I have time to check out the version z2 update.
I always wanted the mouse wheel command but never requested it.
I just thought about any sprites being used. A programer could move a sprite forward or send it backwards(deeper) while creating a 2d game with these commands.
That would make it easier deciding where to place some sprites in the background
while creating a game if coded right. There is always some background sprite a person never is satisfied with where its Z depth should be.
...XpMe v1.2

http://tilemusic.com/