Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
SimpleLoopLib Saving and loading tables, display. functions, transition.to, Better Print, many more. — Gideros Forum

SimpleLoopLib Saving and loading tables, display. functions, transition.to, Better Print, many more.

SimpleLoopSimpleLoop Member
edited October 2012 in Code snippets
Here is our library with many functions to simplify otherwise complicated tasks.

Features include:
Easy Saving and loading of tables
Extended Print can show contents of tables etc..
transition.to similar to C* SDK
display.new(obj) similar to C* SDK Including Display Groups
Colours using RGB similar to C* SDK
Some functions including easy physics have been added but are not yet documented.
Some other functions.

Download from:
https://github.com/SimpleLoop/SimpleLoopLib

To use add files in folder to project
Right click simpleLoopLib.lua in the gideros project manager and select code dependencies and tick scenemanager.lua
do the same for scenemanager.lua and tick gtween.lua
and the same again for gtween.lua and tick easing.lua
and then the same for your main.lua and tick simpleLoopLib.lua

This will make all the functions available and remove all errors.

Here is an example of saving and loading of tables
[fileName] is an optional parameter

:: FIRST LOAD EXAMPLE (OPTIONAL)::

Defaults ({
bestScore = 200
volume = .4
})

canLoad = Load()
if canLoad == false then
Save() -- Saves defaults to file
end

:: SAVING EXAMPLE ::

local myData = {}
myData.bestScore = 500
myData.volume = .8
myData.name = "Test"

Save(myData, [fileName])

:: SAVING EXAMPLE 2::

local myData = {bestScore = 500, volume = .8, name = "Test"}

Save(myData, [fileName])

:: LOADING EXAMPLE ::

local myData = Load([fileName])
print(myData.bestScore) <-- 500
print(myData.volume) <-- .8
print(myData.name) <-- "Test"

Will update the Readme and add a sample app ASAP

Enjoy

Likes: Teranth

+1 -1 (+1 / -0 )Share on Facebook

Comments

Sign In or Register to comment.