Difference between revisions of "Loading Order of Lua Files"

From GiderosMobile
(added some more explanations)
m
Line 27: Line 27:
 
=== Example ===
 
=== Example ===
 
<source lang="lua">
 
<source lang="lua">
 +
--!NEEDS:../../tiled/tiled_ellipse.lua
 
--!NEEDS:luashader/luashader.lua
 
--!NEEDS:luashader/luashader.lua
  

Revision as of 04:45, 12 July 2021


Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.png
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


This is very useful if you develop a Lua library that is meant to be used in several projects.

Example

--!NEEDS:../../tiled/tiled_ellipse.lua
--!NEEDS:luashader/luashader.lua

local function makeEffect(name,vshader,fshader)
	...
end

See also

Require

Methods

Events

Constants