mirror of https://github.com/axmolengine/axmol.git
Merge pull request #7478 from Dhilan007/v3-320final
update test case of game controller[lua]
This commit is contained in:
commit
2b3fbd743a
|
@ -276,6 +276,10 @@ function GameControllerTest:registerControllerListener()
|
||||||
holder._buttonL1:setColor(cc.c3b(19,231,238))
|
holder._buttonL1:setColor(cc.c3b(19,231,238))
|
||||||
elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_SHOULDER then
|
elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_SHOULDER then
|
||||||
holder._buttonR1:setColor(cc.c3b(19,231,238))
|
holder._buttonR1:setColor(cc.c3b(19,231,238))
|
||||||
|
elseif keyCode == cc.ControllerKey.BUTTON_LEFT_THUMBSTICK then
|
||||||
|
holder._leftJoystick:setColor(cc.c3b(19,231,238))
|
||||||
|
elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_THUMBSTICK then
|
||||||
|
holder._rightJoystick:setColor(cc.c3b(19,231,238))
|
||||||
else
|
else
|
||||||
local ketStatus = string.format("Key Down:%d",keyCode)
|
local ketStatus = string.format("Key Down:%d",keyCode)
|
||||||
holder._externalKeyLabel:setString(ketStatus)
|
holder._externalKeyLabel:setString(ketStatus)
|
||||||
|
@ -301,6 +305,10 @@ function GameControllerTest:registerControllerListener()
|
||||||
holder._buttonL1:setColor(cc.c3b(250,255,255))
|
holder._buttonL1:setColor(cc.c3b(250,255,255))
|
||||||
elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_SHOULDER then
|
elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_SHOULDER then
|
||||||
holder._buttonR1:setColor(cc.c3b(250,255,255))
|
holder._buttonR1:setColor(cc.c3b(250,255,255))
|
||||||
|
elseif keyCode == cc.ControllerKey.BUTTON_LEFT_THUMBSTICK then
|
||||||
|
holder._leftJoystick:setColor(cc.c3b(250,255,255))
|
||||||
|
elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_THUMBSTICK then
|
||||||
|
holder._rightJoystick:setColor(cc.c3b(250,255,255))
|
||||||
else
|
else
|
||||||
local ketStatus = string.format("Key Up:%d",keyCode)
|
local ketStatus = string.format("Key Up:%d",keyCode)
|
||||||
holder._externalKeyLabel:setString(ketStatus)
|
holder._externalKeyLabel:setString(ketStatus)
|
||||||
|
|
Loading…
Reference in New Issue