How to use a LUA file for every scene?

Hello,

When I would add a menu option from every scene I would leave the scene I was at and load the menu as a scene itself. Now I want to create a menu that slides in but is used for multiple scenes. I read about the Require that can be used but from what I understand is its for returning data such as a table.

My question is if there is any way to actually add and draw the table from one LUA file used in the project? I am using composer in my project.

Thanks,

Warren

I’m a little confused as to what the question is, but you can reload the same composer scene from any scene. You can also show it as an overlay if that’s what you’re intending.

You can have modules that do things and use them in multiple scenes. In fact Composer is designed to allow a heads up display play above any composer scene. You can have your slide in menu created in main.lua and hidden and then require the slide in panel in each scene and if it has a show function then call it when you need it.

See this tutorial:  https://coronalabs.com/blog/2014/04/08/widgets-creating-a-sliding-panel/

Rob

I’m a little confused as to what the question is, but you can reload the same composer scene from any scene. You can also show it as an overlay if that’s what you’re intending.

You can have modules that do things and use them in multiple scenes. In fact Composer is designed to allow a heads up display play above any composer scene. You can have your slide in menu created in main.lua and hidden and then require the slide in panel in each scene and if it has a show function then call it when you need it.

See this tutorial:  https://coronalabs.com/blog/2014/04/08/widgets-creating-a-sliding-panel/

Rob