How to require gui_script? (SOLVED)


Hello I am antiquating myself with the engine. I am familiar with lua but havn’t used gui_scripts obviously.
I was wondering how I can require a gui_script in a lua script for reference.
I currently have
require “main.Login”
which doesn’t work.
I also tried require"main.Login.gui_script"
which also did not work.

also is there a place on the forum I can recruit for a project?


Defold knows of four different kind of “script” files:

  • Lua modules (*.lua). These are required using normal Lua syntax and the require() function. This file type is the only one that you can require()
  • Script files (*.script). These are attached as components to game objects in the editor. Use these to manipulate game objects. You can require() modules from .script files.
  • Gui script files (.gui_script). These are associated with GUI scenes. You use them by creating a GUI scene (.gui) and selecting the root of the GUI scene in the editor Outline and in the Properties panel point to the gui_script file. You can require() modules from .gui_script files.
  • Render script files (*.render_script). Use this to modify the render pipeline. Select which one to use from a .render file (which in turn is referenced from game.project). You can require() modules from .render_script files.

Check the Collaborate section


Thank you :slight_smile: