Software Need Help Drawing Lines Using Script API Commands

Orville

Donator
Donator
Joined
Dec 13, 2013
Messages
10
Reaction score
0
Points
1
Location
South Korea
I am studying the Script API and for practice am developing a script MFD. In the MFD I'd like to draw certain lines and shapes using colors other than solid bright green which is apparently the default type. However, I cannot figure out how to use the available sketchpad and MFD script commands to do this. For example to draw a dim dashed yellow line I have tried various commands such as mfd:get_defaultdisplay(1,1,2) and skp:set_pen(mfd:get_defaultdisplay(1,1,2)), but so far have not yet figured out the correct script command(s) to change line colors, brightness, etc.

Could someone explain or provide a sample of the proper script command, or sequence of Sketchpad and/or MFD script commands, that allow one to specify and change pen colors, solid/dashed lines, bright/dim lines? Thank you.

---------- Post added 05-04-17 at 10:17 ---------- Previous post was 05-03-17 at 21:41 ----------

Not sure if it's bad form to reply to your own post, but just wanted to say that I figured out how to control line colors, brightness, and type in ScriptMFD. For example, to draw a dim yellow line the necessary command is skp:set_pen(mfd:get_defaultpen(1,1,2)).

I thought I had tried this exact command earlier and failed but today it worked. Guess I somehow managed to purge the gremlin that was lurking in my code.

I am having a blast playing with Orbiter, learning basic orbital mechanics, and learning to code with LUA and the Script API. Maybe I'll get up the nerve to learn C++ next.

Thanks to all in the Orbiter community who have supported, and continue to support, the development of this program.

Orville

:hailprobe:
 
I find Orbiter script / LUA to be faster to develop than C++
The only thing the script lacks is support for keyboard presses, but you can get around that by creating a MFD.

Anyway, the best way to get help is to post your code. Isolated instructions don't tell much, they may work or not depending on context.
 
Back
Top