Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/thoda-dev/du_render_script_library. A library to build renderscript in boards without writting it as a full string
···1414script:addBox(MyFirstLayer,0,0,100,100)
15151616if not script:isTooLong() then
1717- screen.setRenderScript(tostring(script))
1717+ script:sendToScreen(screen)
1818else
1919 system.print("WARNING: Script too long!! Length is actualy " .. script:len() .. " / " .. script:getMaxSize())
2020end
+26
RenderScript.lua
···385385 self._s = self._s .. line .. '\n'
386386 end,
387387388388+389389+ --************************************************************************************************************
390390+ -- Third party libraries support
391391+ --************************************************************************************************************
392392+393393+ --- Use a third party library in the renderscript
394394+ ---@param libraryName string The name of the library to use
395395+ use = function (self, libraryName)
396396+ self._s = self._s .. 'local ' .. libraryName .. '=require("' .. libraryName .. '");'
397397+ end,
398398+399399+ --- Use the Atlas library in the renderscript
400400+ useAtlas = function (self)
401401+ self._s = self._s .. 'local atlas=require("atlas");'
402402+ end,
403403+404404+ --- Use the JSON (dkjson) library in the renderscript
405405+ useJSON = function (self)
406406+ self._s = self._s .. 'local json=require("dkjson");'
407407+ end,
408408+409409+ --- Use the RSLib library in the renderscript
410410+ useRSLib = function (self)
411411+ self._s = self._s .. 'local rslib=require("rslib");'
412412+ end,
413413+388414 --************************************************************************************************************
389415 -- utilities to add to the renderscript that are not by default in game
390416 --************************************************************************************************************