 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
bear
Joined: 16 Jan 2007 Posts: 7 Location: sthlm, Sweden
Digg It |
Posted: Tue Jan 30, 2007 2:10 pm Post subject: CursorPos only working with Mouse and not fake cursors? |
|
|
| Code: | | Mouse.CursorPos = [var.x1, var.y1] |
works fine while
| Code: | | Cursor1.CursorPos = [var.x2, var.y2] |
(var.x1/var.x2 and var.y1/var.y2 calculated the same way but from wiimote1/2) results in glovepie 0.29 closing down without any error message when running my simple IR mouse script. Setting Cursor1.CursorPosX and Cursor1.CursorPosY one by one works but it seems less than ideal to send two different mouse event messages like glovepie seems to do when setting CursorPosX and CursorPosY separately.
In some cases (like drawing in paint) the difference between setting both x and y values of the cursor position instead of one at a time makes a huge difference. |
|
| Back to top |
|
 |
TiagoTiago
Joined: 20 Jan 2007 Posts: 710 Location: Brasil
Digg It |
Posted: Tue Jan 30, 2007 7:05 pm Post subject: |
|
|
are you sure thoser vsriables are returning the desried values? _________________ please put the scripts on the wiki so they dont get lost as new stuff is posted!
phpBB doesnt like me,somtimes it will forget to warn me about new replies to threads I asked it to,if you see a thread I should have responded, could please email me? |
|
| Back to top |
|
 |
bear
Joined: 16 Jan 2007 Posts: 7 Location: sthlm, Sweden
Digg It |
Posted: Tue Jan 30, 2007 7:52 pm Post subject: |
|
|
It works if I replace Cursor1.CursorPos with Cursor1.CursorPosX and Cursor1.CursorPosY but I would like to only generate one mouse event message per wiimote.
Here's the whole script for reference:
| Code: | Cursor1.visible = true
if wiimote1.dot1vis then
var.xpos = 1023 - wiimote1.dot1x
var.x1 = MapRange( Smooth(var.xpos, 2, 1), 0, 1023, 0, (Screen.Width - 1))
var.y1 = MapRange( Smooth(wiimote1.dot1y, 2, 1), 0, 767, 0, (Screen.Height - 1))
Mouse.CursorPos = [var.x1, var.y1]
endif
if wiimote2.dot1vis then
var.xpos2 = 1023 - wiimote2.dot1x
var.x2 = MapRange( Smooth(var.xpos2, 2, 1), 0, 1023, 0, (Screen.Width - 1))
var.y2 = MapRange( Smooth(wiimote2.dot1y, 2, 1), 0, 767, 0, (Screen.Height - 1))
//This closes down glovepie :(
//Cursor1.CursorPos = [var.x2, var.y2]
Cursor1.CursorPosX = var.x2
Cursor1.CursorPosY = var.y2
endif
Mouse.LeftButton = Wiimote1.B
Mouse.RightButton = Wiimote1.A
Mouse.MiddleButton = Wiimote1.Home
Cursor1.LeftButton = Wiimote2.B
Cursor1.RightButton = Wiimote2.A
Cursor1.MiddleButton = Wiimote2.Home |
|
|
| Back to top |
|
 |
CarlKenner Site Admin
Joined: 29 Nov 2006 Posts: 614
Digg It |
Posted: Wed Jan 31, 2007 2:33 am Post subject: |
|
|
| Sorry, I'll see if I can fix it. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|