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/SimpleLoopLibTo 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
Comments
http://www.giderosmobile.com/forum/discussion/1780/extending-gideros/p1
@ar2rsawseen feel free to use anything you want from it, attribution always appreciated but not required.
@gorkem that is a great idea.
The texturepacker .png and .txt files must be in the same location
spriteName is the file name without the .png or .txt on the end
local player = loadSprite(string spriteName, int startFrame, int endFrame)
Creates an animated sprite which animates between the specified frames.
To-Do:
Set speed of sprite.
cheers
evs