Home Kwiksher Forums Kwik4 Overlay
Tagged: overlay
-
otterslidestudio@aol.com
ParticipantMarch 13, 2020 at 11:37 pm #85947I 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
KeymasterMarch 15, 2020 at 4:38 am #85949In 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" )
otterslidestudio@aol.com
ParticipantMarch 15, 2020 at 5:43 pm #85952I’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.
otterslidestudio@aol.com
ParticipantMarch 15, 2020 at 6:09 pm #85953I 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
KeymasterMarch 15, 2020 at 10:09 pm #85955Here 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 ) ----------
otterslidestudio@aol.com
ParticipantMarch 15, 2020 at 11:44 pm #85956Thank you. That clears things up for me. I keep forgetting to require composer.
-
AuthorPosts
You must be logged in to reply to this topic.