Coronasdk 弹出窗口(控制器)。科罗纳SDK

Coronasdk 弹出窗口(控制器)。科罗纳SDK,coronasdk,Coronasdk,我正在主菜单中创建一个弹出窗口。在弹出屏幕中执行closePopUp(),并显示消息“无法更改弹出窗口内的场景”。帮助解决问题 和openPopUp director:openPopUp("exit_screen", popClosed ); 控制器:openPopUp(“退出屏幕”,Popup关闭); 试试这个。。。。 你应该把director.lua文件放在你的项目文件夹中 main.lua local director=require("director") local mainGr

我正在主菜单中创建一个弹出窗口。在弹出屏幕中执行closePopUp(),并显示消息“无法更改弹出窗口内的场景”。帮助解决问题

和openPopUp

director:openPopUp("exit_screen", popClosed );
控制器:openPopUp(“退出屏幕”,Popup关闭); 试试这个。。。。 你应该把director.lua文件放在你的项目文件夹中

main.lua

local director=require("director")
local mainGroup=display.newGroup()

function clean(event)
print("clean")
end

function main()
display.setStatusBar(display.HiddenStatusBar)
mainGroup:insert(director.directorView)
director:changeScene("screen1")
end

main()
module(...,package.seeall)

function clean(event)
print("clean")
end

new =function()
local localGroup=display.newGroup()
local circle=display.newCircle(display.contentWidth/2,display.contentHeight/2,80)
circle:setFillColor(220,25,220)
local text=display.newText( "click to openPopUp", 0, 0, native.systemFontBold, 16 )
text.x=circle.x
text.y=circle.y
localGroup:insert(circle)

local listener=function(event)
if(event.phase=="ended")then
    director:openPopUp( "screen2","flip")
end
  end

circle:addEventListener("touch",listener)
return localGroup;
 end
module(...,package.seeall)
function clean(event)
print("clean")
  end

new =function(prams)
local localGroup=display.newGroup()
local circle =display.newCircle(display.contentWidth/2,display.contentHeight/2,100)
circle:setFillColor(255,0,0)

local text=display.newText( "click to closePopUp", 0, 0, native.systemFontBold, 16)
text.x=circle.x
text.y=circle.y

     local listener=function(event)
if(event.phase=="ended")then
    circle:removeSelf()
    text:removeSelf()
    director:closePopUp()
end

    end

circle:addEventListener("touch",listener)
localGroup:insert(circle)
return localGroup;
    end

屏幕1.lua

local director=require("director")
local mainGroup=display.newGroup()

function clean(event)
print("clean")
end

function main()
display.setStatusBar(display.HiddenStatusBar)
mainGroup:insert(director.directorView)
director:changeScene("screen1")
end

main()
module(...,package.seeall)

function clean(event)
print("clean")
end

new =function()
local localGroup=display.newGroup()
local circle=display.newCircle(display.contentWidth/2,display.contentHeight/2,80)
circle:setFillColor(220,25,220)
local text=display.newText( "click to openPopUp", 0, 0, native.systemFontBold, 16 )
text.x=circle.x
text.y=circle.y
localGroup:insert(circle)

local listener=function(event)
if(event.phase=="ended")then
    director:openPopUp( "screen2","flip")
end
  end

circle:addEventListener("touch",listener)
return localGroup;
 end
module(...,package.seeall)
function clean(event)
print("clean")
  end

new =function(prams)
local localGroup=display.newGroup()
local circle =display.newCircle(display.contentWidth/2,display.contentHeight/2,100)
circle:setFillColor(255,0,0)

local text=display.newText( "click to closePopUp", 0, 0, native.systemFontBold, 16)
text.x=circle.x
text.y=circle.y

     local listener=function(event)
if(event.phase=="ended")then
    circle:removeSelf()
    text:removeSelf()
    director:closePopUp()
end

    end

circle:addEventListener("touch",listener)
localGroup:insert(circle)
return localGroup;
    end


屏幕2.lua

local director=require("director")
local mainGroup=display.newGroup()

function clean(event)
print("clean")
end

function main()
display.setStatusBar(display.HiddenStatusBar)
mainGroup:insert(director.directorView)
director:changeScene("screen1")
end

main()
module(...,package.seeall)

function clean(event)
print("clean")
end

new =function()
local localGroup=display.newGroup()
local circle=display.newCircle(display.contentWidth/2,display.contentHeight/2,80)
circle:setFillColor(220,25,220)
local text=display.newText( "click to openPopUp", 0, 0, native.systemFontBold, 16 )
text.x=circle.x
text.y=circle.y
localGroup:insert(circle)

local listener=function(event)
if(event.phase=="ended")then
    director:openPopUp( "screen2","flip")
end
  end

circle:addEventListener("touch",listener)
return localGroup;
 end
module(...,package.seeall)
function clean(event)
print("clean")
  end

new =function(prams)
local localGroup=display.newGroup()
local circle =display.newCircle(display.contentWidth/2,display.contentHeight/2,100)
circle:setFillColor(255,0,0)

local text=display.newText( "click to closePopUp", 0, 0, native.systemFontBold, 16)
text.x=circle.x
text.y=circle.y

     local listener=function(event)
if(event.phase=="ended")then
    circle:removeSelf()
    text:removeSelf()
    director:closePopUp()
end

    end

circle:addEventListener("touch",listener)
localGroup:insert(circle)
return localGroup;
    end

Hi Bakunov,你能展示一下你的
closePopUp()
代码吗?这样我们就可以帮你了?