Hello guys,
I need a rescue! Ok, here my problem. I have a analog joystick and a weapon change button. I can move the joystick or press the weapon button but not do both. So I say ok, all I need is add the line:
system.activate( " multitouch" )
Still no go. Actually it seems that it does not matter that i am using the analog joystick which I thought it may not work with multitouch. Actually simply keeping a finger on the screen seems to block the touch to the joystick move, the exit button and the weapon button. Of course i start reading about multitouch and searching on this forum but frankly I am a little confused now! All I need is being able to move the joystick and change the weapon mode at the same time.
Below is my weapon button touch function. As you can I am just switching the weapon mode and changing the label of the button from GUN to LASER. I am using a widget button.
Any pointers will be greatly appreciated it.
Thanks guys.
Mo
I am using the following code for the joystick (thanks Jay!!)
http://developer.anscamobile.com/code/simple-analog-stick-joystick-module
And here the code for the weapon button:
[lua]local function btWeapon (event)
if event.phase == “release” then
– Play Sound
if fxOn == true then audio.play( tapSound ) end
if weaponMode == 1 then
weaponMode = 2
btWeapon:setLabel( “GUN” )
elseif weaponMode == 2 then
weaponMode = 1
btWeapon:setLabel( “LASER” )
else
return true
end
end
end
btWeapon = widget.newButton{
id = “btWeapons”,
left = right - 110 ,
top = bottom - 180,
label = “LASER”,
width = 135, height = 41,
cornerRadius = 8,
onEvent = btWeapon,
default=imagesHudPath…“weaponLabel.png”,
over=imagesHudPath…“weaponLabelOver.png”,
font = “Gears of Peace”,
fontSize = 14,
offset = 0,
labelColor = { default={ 255,255,255}, over={ 177,243,255 } }
}[/lua]
[import]uid: 49236 topic_id: 24143 reply_id: 324143[/import]