Boris Koenig wrote:
> 1)    I would like to be able to display a simple text string at
>     runtime in the upper left corner of the screen using
>     Nasal (in order to display simple in-flight information).

Check out gui.popupTip() to see if that does what you want.  If not,
you can look at the implementation (it is 100% Nasal code, and just
uses the GUI module) to do something similar.

> 2)    And: Is it possible to load a Nasal file while the game is
>     running and execute it then ?

Not currently.  Adding it would actually be non-trivial, because (as
in most similar languages) "loading" and "running" a script are the
same thing.  Being able to load a script from Nasal code is equivalent
to running a recursive Nasal interpreter context, something that the
current implemention doesn't support.

I suppose we could wire up an fgCommand that did a script load, which
would work fine so long as you called it from a non-nasal context
(keyboard binding, etc...).

Fixing the interpreter to allow multiple contexts is definitely worth
doing.  This would also allow for a non-callback API, where a script
could "sleep" for a bunch of frames and be woken up later on.


Flightgear-devel mailing list

Reply via email to