Hi all,
I would like to know how to remove graphics when I press on a button.
When I press “My Settings” Button,I want to remove “Select Player” graphics at the right hand side panel.When I press “Select Player”,I want to remove “My Settings” graphics at the right hand side panel.
…But I cannot remove object like this…
![]()
My code (in order to remove graphics) are as follows,
local function spButtonEvent( event )
local btn = event.target
if event.phase == “press” then
transition.to(panel, { time=400, rotation=360})
if panelWelcome ~= nil then
panelWelcome:removeSelf()
panelWelcome = nil
if animation1~= nil then
animation1:removeSelf()
animation1 = nil
end
if animation2~= nil then
animation2:removeSelf()
animation2 = nil
end
if animation3~= nil then
animation3:removeSelf()
animation3 = nil
end
if audioSettingTitle~=nil then
audioSettingTitle:removeSelf()
audioSettingTitle = nil
end
if voiceSlider~=nil then
voiceSlider.isVisible = false
voiceSlider= nil
end
if soundEffectsSlider~=nil then
soundEffectsSlider:removeSelf()
soundEffectsSlider = nil
end
if backgroundmusicSlider~= nil then
backgroundmusicSlider:removeSelf()
backgroundmusicSlider = nil
end
if fbLogOnButton ~= nil then
fbLogOnButton:removeSelf()
fbLogOnButton = nil
end
if pwdOnButton ~= nil then
pwdOnButton:removeSelf()
pwdOnButton = nil
end
if editMyProfileButtonSheet~= nil then
editMyProfileButton.isVisible = false
end
if adjustYourSettingMascot~= nil then
adjustYourSettingMascot:removeSelf()
adjustYourSettingMascot = nil
end
end
local spButton = widget.newButton{
id = “selectPlayerButton”,
width = 132*Xa, height = 164*Ya,
onEvent = spButtonEvent
}
spButton.x = displayOffsetX(565,offsetx)
spButton.y = displayOffsetY(500,offsety1,offsety2)
spButton.alpha = 0.01
May I know how to remove graphics properly in Corona SDK?..Please see the attached images.Please guide me…Thanks a lot!!!..
Warm Wishes,
John