Understanding how Kwik works
kwk XML Project File
Understanding how Kwik works
A project folder created under your Default Project folder (you set this via Settings->General tab). Kwik automatically creates a project folder when you create a new project. This folder has the same name of your project, with spaces being replaced by _ (underscore)
YourProject.kwk is a XML file (text format) that contains all project settings plus references to all interactions, animations, etc, you set via the Kwik interface (more on that later)
After hitting the Publish button for the first time, Kwik will create, under your project folder, a folder named build4, which will hold all content required by Corona Simulator to simulate and/or build your final app.
assets folder holds the copies of audio files, spritesheets etc that you set with Kwik Panel.
images folder holds all image files used in the project;
commands folder holds the actions you set with Action/Button panel.
components are found in components folder, p
/<component_name>.lua, each containing the code for the page components.
contexts defines events&commands
custom folder where you can put custom lua files of commands or components. The custom lua file is loaded instead of the original one.
extlib contains the 3rd parties lua files see the list of ext libs from kwiksher's github
lib folder is free to use for you
mediators handles events&page
views handles composer
vo defines layer names
Application.lua starts the system
assemble.bat is for screen capture with Corona simulator.Please remove it for final device build
assemble.command is for screen capture with Corona simulator. Please remove it for final device build
build.settings, which contains information about each target platform, and the resources need by each one;
config.lua, which contains information about resolutions of each platform;
main.lua, which is the first file that Corona reads while opening your project;
kwk Project file
As mentioned above, the “kwk” file is the one holding the intelligence of your project. For every action you associate to a layer, a page or your entire project, Kwik will add this information into the kwk file. If you open your kwik file (any text editor will open it), you will see something like this:
As you can see, this a XML (extended Markup Language) file, containing references (they are called children, when they are indented. For example,
When you publish your project, Kwik will read content from your Photoshop page file (each layer will be exported as an image, the start position/alpha/etc of each layer will be capture, etc) and “mix” with the content of the kwk, to create the appropriated code for each page
Sometimes you like to change some file paths of .psd or .mp3 etc. Kwik defaults project folder is ~/Documents/Kwik/YourProject. if you like to change your project folder from documents folder to Desktop. You need to edit .kwk
Fistly make sure you set the project folder at ~\Desktop\K4
<pages> <page id="page1"> <name>page1</name> <number>1</number> <file>~/Documents/Kwik/HelloWorld/page1.psd</file> <fileName>page1.psd</fileName> </page> </pages>
<pages> <page id="page1"> <name>page1</name> <number>1</number> <file>~/Desktop/K4/HelloWorld/page1.psd</file> <fileName>page1.psd</fileName> </page> </pages>
Other folders in Your Project Folder
You find these folders and they are automatically created by Kwik
backups contains the backups of .kwk file. If you like to rewind your work, copy it from this folder and replace the kwk file in the root folder.
json folder is for kwik internal use to publish json files before making lua files.
kaboom folder is also internal folder to be used for creating/editing particles
temp is also internal folder
tmplt contains the template files from which kwik uses to generate lua files. You can modify the files in tmplt folder to make custom codes of yours. When Kwik is updated, the template folder is updated with Project Properties > Update tmplt. The old tmplt folder is renamed when updating tmplt.
The latest tmplt is available from GitHub of Kwiksher. Every time, a daily build of Kwik is released, the git repo is updated too. So if you prefer to use git, just clone the repo.