Home / Topic / Overlay

Overlay

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • #85947

    I made extensive use of overlays in Kwik 3 via external code, but I do not understand how to use it in Kwik 4 yet.

    The code was simple, here is an example:

    local options = {
    isModal = true,
    effect = “fade”,
    time = 400,
    }

    composer.showOverlay( “page_32”, options )

    How would I do that now?

    Yamamoto
    Keymaster
    #85949

    In Kwik4, the files for composer are stored in build4/view folder, So the syntax for loading a page is like below

    
    local pnum = 32
    composer.showOverlay( "views.page0"..pnum.."Scene" )
    
    #85952

    I’m sorry, but I’m not knowledgeable enough with the actual coding specifics to infer how to use the example you posted. It is easier for me to understand if you can tell me exactly how I would rewrite the code example I posted. Thank you.

    #85953

    I should mention that the bit of code I posted is the entirety of what I have inside the external lua file that I use to open an Overlay. In this case the overlay is page 32 of this project. I call this overlay.lua from a button in other pages.

    Yamamoto
    Keymaster
    #85955

    Here is the whole lines for you external code to showOverlay. I added require func and option for showOverlay func. It shows up page 32. Put it in .lua file and loaded it in the action of a button. You can change pnum to load a different page.
    https://docs.coronalabs.com/api/library/composer/showOverlay.html

    
    ----------
    local composer = require("composer")
    
    local options = {
    isModal = true,
    effect = “fade”,
    time = 400,
    }
    
    local pnum = 32 
    composer.showOverlay( "views.page0"..pnum.."Scene", options )
    ----------
    

    #85956

    Thank you. That clears things up for me. I keep forgetting to require composer.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.