Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>try this .... u should place the director.lua file in your project folder</p> <p><strong>main.lua</strong></p> <pre><code>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() </code></pre> <hr> <p><strong>screen1.lua</strong></p> <pre><code>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 </code></pre> <p><img src="https://i.stack.imgur.com/uZNFJ.png" alt="enter image description here"></p> <hr> <p><strong>screen2.lua</strong></p> <pre><code>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 </code></pre> <p><img src="https://i.stack.imgur.com/bWDGA.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload