The Flashlight plugin provides access to the flash LED light source, which can be used as a torch.
To get access to the plugin, you need to support me on Patreon https://www.patreon.com/lerg
To use this plugin, add an entry into the plugins table of build.settings. When added, the build server will integrate the plugin during the build phase.
You also need to add a special function at the top of the build.settings file and provide your Patreon email and an access key. The access key you get when you become a patron.
local spiralcodestudio_patreon_email = 'YOUR_EMAIL'local spiralcodestudio_key = 'YOUR_ACCESS_KEY'localfunctionspiralcodestudio_plugin(name)
local plugin = {publisherId = 'com.spiralcodestudio', supportedPlatforms = {}}
local platforms = {'android', 'appletvos', 'appletvsimulator', 'iphone', 'iphone-sim', 'mac-sim', 'win32-sim'}
for i = 1, #platforms dolocal platform = platforms[i]
plugin.supportedPlatforms[platform] = {url = 'https://build.spiralcodestudio.com/' .. spiralcodestudio_patreon_email .. '/' .. spiralcodestudio_key .. '/solar2d/' .. name .. '_' .. platform .. '.tgz'}
endreturn plugin
end
settings = {
plugins = {
['plugin.flashlight'] = spiralcodestudio_plugin('flashlight')
}
}
Example
local flashlight = require('plugin.flashlight')
-- -- --
flashlight.on()