[SOLVED] Using multiple virtual joysticks at the same time (multitouch)

I've been using the x-pressive analog joystick library:

http://developer.anscamobile.com/code/simple-analog-stick-joystick-module

And like the page says, it basically works right out of the box. However, although you can add more than one to the screen, you can only use one at a time.

I tried commenting out the "return true" line in the lib_analog_stick.lua file (line#157) but it didn't make any difference.

I have a feeling I'm not the first person that's tried to use two virtual joysticks simultaneously, although I didn't see any other posts about this. Could anyone provide some insight?

Here's the instantiation of the joysticks:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- allow multi-touch
system.activate( "multitouch" )
 
-- CREATE ANALOG STICKS
local StickLib   = require("lib_analog_stick")
local stickLeft = StickLib.NewStick(
        {
        x             = display.contentWidth*.2,
        y             = display.contentHeight*.85,
        alpha         = 0.3,
        thumbSize     = 16,
        borderSize    = 32,
        snapBackSpeed = .2,
        R             = 255,
        G             = 255,
        B             = 255
        } )
 
local stickRight = StickLib.NewStick(
        {
        x             = display.contentWidth*.8,
        y             = display.contentHeight*.85,
        alpha         = 0.3,
        thumbSize     = 16,
        borderSize    = 32,
        snapBackSpeed = .2,
        R             = 255,
        G             = 255,
        B             = 255
        } )

I haven't looked at that particular joystick stuff in ages, but at any point is it setting focus? That could be a contributor if so.

thanks, got it.

views:1872 update:2011/10/18 15:01:22
corona forums © 2003-2011