Estrela for Luxinia

Install

Information on how to get Estrela is here.

Run

Running estrela.exe/zbstudio.exe should give you something like this.

  • Project: this will be a tree-view of a project directory. When luxinia is the interpreter used in Estrela, this will be the "main projectpath" luxinia is started with.
  • Editor: multiple files can be edited at the same time in the main editor window
  • Output: here the output stream of the commands (typically Luxinia or Cg compiler) is printed to. You can find error messages or other prints.
  • Lua Shell: with the shell you can directly enter Lua code into the lower box (no luxinia commands available just plain lua) and execute it with CTRL+ENTER or pressing RUN. (also seen in setup image)

If you don't have the Cg Toolkit installed, you will not get the CgCompiler? entry in the main menu. More details in this tutorial.

Setup

By default Luxinia should be the main interpreter. That is when you do Project→Run (F6) luxinia is started.

As Estrela is still work in progress, not all settings you click with the UI are stored on exit. Typically only window layout and file/project history is saved.

Other settings should be put int /cfg/user.lua. Let's create this file, here is what mine looks like:

local G = ... -- point to the global environment in the script
-- update app configuration to load everything
G.ide.app.loadfilters.tools = function() return true end
G.ide.app.loadfilters.specs = function() return true end
G.ide.app.loadfilters.interpreters = function() return true end

-- by default luxinia path is 
-- looked for with the "LUXINIA" environment variable
-- but you can do relative or absolute path 
-- specification as well. It is crucial
-- that luxinia can be found this way.

path.luxinia = "../../luxinia/"

interpreter = "luxinia"

-- explained later
acandtip.shorttip = true
acandtip.nodynwords = true

-- as I have some apps with German characters
-- I need this.
editor.iofilter = "GermanUtf8Ascii"

-- you can copy the content of one of
-- the 3 style files in here and experiment
-- with the settings.
styles = {
...
}

A full explanation of how the config is made up can be found in doc/defs.lua

Projects

Best is to associate .lua, .prt, .mtl, .shd and .cg files with estrela.exe, so you can open them on double click in explorer. But you can also drag and drop files on estrela to open them.

let's open a file from the tutorials project path (any will do) and click the last button in the toolbar. This is equivalent to Project→Project Directory→From current filepath.

Now you will see that this became our active project (as seen in the setup screenshot above). You can also manually enter or browse a directory in the Project main drop down text field or (...) button. With the drop down text field you can quickly jump between your projects. Your project paths and opened files will be stored when estrela closes.

Now press F6 to launch your current project, and it will open luxinia and its output will be printed into estrela's output window.

If you press F7 on a .lua file it is parsed by Lua and checked for syntax errors. Nothing else, so you don't need to compile things, but it's useful if you wrote plenty new code and prior running want to check you haven't forgot a "then" or "end" in your code or similar simple mistakes.

When saving new files (untitled.lua), the first path the dialog chooses is the current selected subdirectory in the project explorer.

Autocomplete and tooltip

By default all words you enter become "dynamic words" and are also suggested by the autocomplete mechanism. Sometimes this maybe a bit too much, especially fixing spelling errors aren't taken over. You can disable this feature in your cfg/user.lua file with acandtip.nodynwords = true.

Then you will only get autocomplete for luxinia's, lua's or Cg keywords and functions/classes.

When you just entered a function a tooltip will appear. As estrela doesnt know the type of a variable, multiple classes for a function might be possible (unless you specified with class.func). Only a short part of description is presented when the config's acandtip.shorttip = true is active.

Inside the function bracket, when you pass the arguments, you can always bring up the tooltip again with CTRL+T, this will always print the full text regardless of shorttip state.

And with class specified

Be aware currently this only works in the same line the function is written.

Quicksearch

Pressing F3 with a active selection will search the phrase in the same file. (F3 downwards, SHIFT-F3 upwards, wrapping around the file). Double click a word for selecting it.