Hi, i am a windows corona user. After updating my Corona to the latest version of the windows SDK, i have noticed that some of my buttons dont seem to function properly. im using the ui.lua library. has anyone else noticed this? thanks [import]uid: 19620 topic_id: 9135 reply_id: 309135[/import]
Ok so i have found out that its actually giving me these issues when i activate Multitouch… hmmm not sure whats up with this [import]uid: 19620 topic_id: 9135 reply_id: 33296[/import]
Also though, with the same buttons that im having problems with, without multitouch active, i sometimes have to click these buttons several times for them to finally register. This is so weird! ive triple checked them against my other buttons that work just fine [import]uid: 19620 topic_id: 9135 reply_id: 33297[/import]
this is on your android device or windows client?
are you running the samples?
can you provide more info?
c. [import]uid: 24 topic_id: 9135 reply_id: 33321[/import]
this is occurring in both the client and on the device. Note that i am NOT using the new corona UI, im using the older ui library. I am trying to pinpoint more of what is making it happen so i dont waste your time. Its really strange because the simulator was freezing when the button would finally register, and i now tried changing 1 line of code, saving it and then it worked… but then i just changed it back to how it was previously, and its still working now… anyways im going to keep testing and post back asap. thanks carlos [import]uid: 19620 topic_id: 9135 reply_id: 33326[/import]
Ok so here is the latest, im sure its probly something in my code but regardless its something i need to fix =p
so lets look at this button code first:
------REPLAY LEVEL FUNCTION---------------
local onReplayTouch = function ( event )
if event.phase == "release" and menuisActive == true and gameActive == false then
fadetimer:cancel()
finishTimer:cancel()
--unload menu
finishGroup:removeSelf();finishGroup=nil
--Enable Control GUI
upButton.isVisible = true
goButton.isVisible = true
pauseButton.isVisible = true
-- MAKE GAME ACTIVE
physics.start()
game.isActive = true
menuisActive = false
--Reset Level
isReplayLevel = true
cleanAndChange()
end
end
replayBtn = ui.newButton{
default = "restart\_level.png",
over = "restart\_level.png",
onEvent = onReplayTouch,
id = "thereplayBtn"
}
replayBtn.x = -800 replayBtn.y = 242
finishGroup:insert(replayBtn)
This code does not register with a single click, but if you click it rapidly, it finally registers and my level replays fine…
here is the same code with a small change:
------REPLAY LEVEL FUNCTION---------------
local onReplayTouch = function ( event )
if event.id == "thereplayBtn" and menuisActive == true and gameActive == false then
fadetimer:cancel()
finishTimer:cancel()
--unload menu
finishGroup:removeSelf();finishGroup=nil
--Enable Control GUI
upButton.isVisible = true
goButton.isVisible = true
pauseButton.isVisible = true
-- MAKE GAME ACTIVE
physics.start()
game.isActive = true
menuisActive = false
--Reset Level
isReplayLevel = true
cleanAndChange()
end
end
replayBtn = ui.newButton{
default = "restart\_level.png",
over = "restart\_level.png",
onEvent = onReplayTouch,
id = "thereplayBtn"
}
replayBtn.x = -800 replayBtn.y = 242
finishGroup:insert(replayBtn)
the change here is that im using the button ID to test if it was pushed. Using it this way, my button registers on the first click, but then the simulator crashes…
ill update with anything more i have [import]uid: 19620 topic_id: 9135 reply_id: 33327[/import]
Alright this is crazy, so check out this code
--------LEVEL SELECT BUTTON------------------
local onLevelSelectTouch = function ( event )
if event.phase == "release" and menuisActive == true and gameActive == false then
cleanAndChange()
end
end
--
--------NEXT LEVEL BUTTON------------------
local onNextLevelTouch = function ( event )
if event.phase == "release" and menuisActive == true and gameActive == false then
isNextLevel = true
cleanAndChange()
end
end
--
ReplayLevelBtn = ui.newButton{
default = "select\_level.png",
over = "select\_level.png",
onEvent = onReplayLevelTouch,
id = "theReplayLevelBtn"
}
--
LevelSelectBtn = ui.newButton{
default = "select\_level.png",
over = "select\_level.png",
onEvent = onLevelSelectTouch,
id = "theLevelSelectBtn"
}
so the replay level button gives me the troubles, and then i have a level select button that does not give me troubles. they call two seperate functions, but they are exactly the same function! i dont know what is going on here. any thoughts? [import]uid: 19620 topic_id: 9135 reply_id: 33332[/import]
Allright, i figured it out. I had some layer issues with some transparent images, thus making it so i could not click my buttons which were behind them… yea… lesson learned =P you can delete this thread if you would like! thanks [import]uid: 19620 topic_id: 9135 reply_id: 33333[/import]
I would recomend using the director class, it performs well and is quite easy and good to use, and fast. Check out my Beach Ball Mayhem app on the android market to see the director class in action. [import]uid: 29181 topic_id: 9135 reply_id: 33346[/import]
Hey rxmarccall,
ninjapig123’s suggestion is a good one; director can save a LOT of headaches, time and effort.
If you need a tutorial, there’s one here; http://techority.com/2010/11/19/how-to-use-scenesscreens-in-corona/
You’ll also find a downloadable sample of it in use so you can see how it works and just how easy it is to implement in your project.
I’ve been using director almost since I started with Corona and it is truly exceptional. [import]uid: 52491 topic_id: 9135 reply_id: 33372[/import]
Thanks for the suggestion guys, but i actually am using director class already, and am loving it =p. I came across this problem because in my game i have some large transparent buttons in the same scene as the end of the level. so thats why they got in the way. anyways thanks for the tips! [import]uid: 19620 topic_id: 9135 reply_id: 33407[/import]