Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Hardware & Software Help
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Hardware & Software Help Hardware & Software related questions & help.

Thread Tools
Old 05-04-2017, 01:17 AM   #1
Orville's Avatar
Default Need Help Drawing Lines Using Script API Commands

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 is offline   Reply With Quote
Thanked by:
Old 05-04-2017, 08:16 AM   #2
Enthusiast !
4throck's Avatar

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.
4throck is offline   Reply With Quote

  Orbiter-Forum > Orbiter Space Flight Simulator > Hardware & Software Help

Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump

All times are GMT. The time now is 09:46 AM.

Quick Links Need Help?

About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.