failrest.blogg.se

Gideros theme
Gideros theme













In this menu, you can set the dependencies between Lua files. If you right click a Lua file and select “Code Dependencies…” from popup menu, “Code Dependencies” dialog opens:

Gideros theme code#

Order of execution by setting the code dependencies between Lua files. Yet better create each lua file as a separate Gideros class, either it will be a scene shown in scene manager or some simple object represented by class, but there should not be some plain code executed in these files, only in aīefore an Gideros application starts, all Lua files at asset library are executed one by one. wrap the code in any other lua file in a scope as function.do all initialization of app etc in a (when all other code was already loaded).to add all additional functionality and modifications to existing classes in a.We can assume that the order of execution is pretty random, but there are two things guaranteed: Loader:addEventListener(Event.COMPLETE, onComplete)īy default Gideros executes all lua files on both players and in real app. Local b = Bitmap.new(Texture.new("|T|image.png")) Local out = io.open("|T|image.png", "wb") This storage may be used for example, to display some temporary data, like images downloaded from somewhere:

gideros theme

To specify a file at temporary directory, append "|T|" to the begining of the file name: io.write("|T|temp.txt") They may be deleted after your application The files created at temporary directory are not guaranteed to exists betweenĭifferent application sessions. You can create and store temporary files at temporary directory. Local size = 2^13 - good buffer size (8K) Here is a quick example how you can copy file from resource directory to document directory: -function to copy file That is for example it is recommended to store database files or other user generated information in document directory The main advantage of document directory are that: To specify a file at document directory, append "|D|" to the begining of the file name: io.write("|D|save.txt") You can create and then read files at document directory to save player progress. The files created at document directory is permanent between different application sessions. You can store application created files at document directory. Note: Resource directory is read-only and you should not try to write any files there. Note: Optionally, you can access the files at resource directory by adding "|R|" to the begining of the file name (but you don’t need to): local sprite1 = Texture.new("|R|gfx/sprite1.png") Local click = Sound.new("audio/click.wav") Local music = Sound.new("audio/game-music.mp3") Local background = Texture.new("gfx/background.png") Local sprite2 = Texture.new("gfx/sprite2.png") Therefore, to access the files at resource directory, specify the file path as it is: local sprite1 = Texture.new("gfx/sprite1.png") Resource directory is the default directory. Is stored at real device and Gideros Player like: /audio/game-music.mp3

gideros theme

The file and folder structure of your asset library shown below Your code, image, audio and all other files are reside at resource directory. Io.read("|T|file.txt") -> open file.txt at temporary directory to read Io.read("|D|file.txt") -> open file.txt at documents directory to read Io.read("|R|file.txt") -> open file.txt at resource directory to read (same as above) Temporary - can be used as temporary storages for files (can be modified by the app)Įxample of accessing each directory: io.read("file.txt") -> open file.txt at resource directory to read.Document - can be used as persistent storages for files (can be modified by the app).Resource - stores your code and assets (can not be modified by the app).

gideros theme gideros theme

You don’t need to know the exact path of resource, document and temporary directories because Gideros provides an easy way You can access these directories using the io library provided by Lua: io.read("data/list.txt") In Gideros runtime, there are 3 kinds of directories: resource, document,













Gideros theme