linerms.blogg.se

Gideros box2d types
Gideros box2d types













gideros box2d types

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: 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 box2d types

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).
  • #Gideros box2d types code

    Resource - stores your code and assets (can not be modified by the app).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 box2d types