Difference between revisions of "Loading Order of Lua Files"
From GiderosMobile
Line 10: | Line 10: | ||
'''PS: the path is relative to the file in which you call --!NEEDS:''' (unless your path begins with a /) | '''PS: the path is relative to the file in which you call --!NEEDS:''' (unless your path begins with a /) | ||
− | |||
This will tell Gideros to load '''your_file.lua''' before the file containing the above code. | This will tell Gideros to load '''your_file.lua''' before the file containing the above code. | ||
Line 18: | Line 17: | ||
<source lang="lua"> | <source lang="lua"> | ||
--!NOEXEC | --!NOEXEC | ||
+ | </source> | ||
+ | |||
+ | |||
+ | You can also assign a name to library files: | ||
+ | <source lang="lua"> | ||
+ | --!LIBRARY:your_library_name | ||
</source> | </source> | ||
Line 23: | Line 28: | ||
'''This is very useful if you develop a Lua library that is meant to be used in several projects.''' | '''This is very useful if you develop a Lua library that is meant to be used in several projects.''' | ||
− | === | + | === Examples === |
<source lang="lua"> | <source lang="lua"> | ||
--!NEEDS:../../tiled/tiled_ellipse.lua | --!NEEDS:../../tiled/tiled_ellipse.lua | ||
--!NEEDS:luashader/luashader.lua | --!NEEDS:luashader/luashader.lua | ||
+ | --!LIBRARY:GiderosUI | ||
local function makeEffect(name,vshader,fshader) | local function makeEffect(name,vshader,fshader) |
Revision as of 02:26, 21 March 2023
Supported platforms:
Available since: Gideros 2020.5
Description
You can now implement Gideros Code Dependency by code instead of Gideros project setting.
--!NEEDS:your_file.lua
PS: the path is relative to the file in which you call --!NEEDS: (unless your path begins with a /)
This will tell Gideros to load your_file.lua before the file containing the above code.
The other Gideros Code Dependency you can implement by code is the exclude file. To tell Gideros the file should not be executed/parsed right on start but will be loaded through a require or a loadfile command, you can write:
--!NOEXEC
You can also assign a name to library files:
--!LIBRARY:your_library_name
This is very useful if you develop a Lua library that is meant to be used in several projects.
Examples
--!NEEDS:../../tiled/tiled_ellipse.lua
--!NEEDS:luashader/luashader.lua
--!LIBRARY:GiderosUI
local function makeEffect(name,vshader,fshader)
...
end
See also