I'm developing pixel art editor that is running on Gideros player. I want the resulting pixel art data in the resource directory (i.e. in the asset folder). However, there is no function that can get absolute path of the asset folder in the Gideros API. Any help?
Comments
The resource directory is the default directory. Therefore, to access the files you specify the file path as it is:
local sprite1 = Texture.new("gfx/sprite1.png")
local sprite2 = Texture.new("gfx/sprite2.png")
You can also use the io library provided by Lua:
io.read("data/list.txt")
Note: the resource directory is read-only and you should not try to write any files there
There is also this thread https://forum.gideros.rocks/discussion/8429/os-execute
PS: I did this a while ago https://mokalux.itch.io/onetiletotileset
Good luck with your pixel art editor, can't wait to see it
Likes: E1e5en
I made a short youtube video.
https://youtube.com/watch?v=7q4j1HUFEYc
Likes: MoKaLux
For accessing directories (temp and docs) the code and link to the docs was written by @MoKaLux.
What's the difference between storing files in the resource directory or elsewhere? You define the path where the file will be stored and you can use it to load it into the application. What is the difficulty?
Likes: MoKaLux
(1) user makes pixel art on Simulator and the created data file (e.g. 'mypixelart.lua') is saved in the resource folder automatically.
(2) user can download png/wav or 3rd-person library directly into the resource folder using command-line-interface in the console.
(3) The users can use the data/library in their project easily (without manually moving data files) e.g., in creating class object like
Or do you have some kind of interpreter for the written code?
Update:
When interpreting the code, you could write and replace the paths to the files yourself, and in the case of using the code "directly", then either solve the problem of copying files to the desired directory (perhaps you may need an additional service / service), or require the student to be sure to prescribe 'D' or 'T' (if you decide to use directories of documents or temporary files).
Likes: salesiopark
https://youtu.be/80_li5RRVuo
On the gideros, same method can be used.
Likes: E1e5en
Good luck with your development!
Likes: salesiopark
Likes: E1e5en, MoKaLux, salesiopark