Board index FlightGear Development Canvas

HUD gyrocompass

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

HUD gyrocompass

Postby 5H1N0B1 » Tue Aug 20, 2019 11:45 am

Hi,
I'm working on an HUD, and I was wondering how to make a gyrocompass on a canvas. My main issue is that I do not want this gyrocompas to cover the full hud span.
This is an example bellow : (because a picture is sometime better then any explanation)
Image

I'm trying to do that with
.moveTo(
.vert(
.setStrokeLineWidth(

I have no clue on how to do that.
5H1N0B1
"Each day, with every person you meet, there is something to learn"
5H1N0B1
 
Posts: 211
Joined: Thu Aug 30, 2012 9:36 am
Location: France
Callsign: 5H1N0B1
IRC name: _5H1N0B1
Version: GIT
OS: Ubuntu

Re: HUD gyrocompass

Postby Thorsten » Tue Aug 20, 2019 12:29 pm

My main issue is that I do not want this gyrocompas to cover the full hud span.


Set a clipping region - the Shuttle HUD ought to have examples for that (if you're out of luck, the Shuttle PFD for sure has, but that code is lengthy)
Thorsten
 
Posts: 11138
Joined: Mon Nov 02, 2009 8:33 am

Re: HUD gyrocompass

Postby 5H1N0B1 » Tue Aug 20, 2019 4:32 pm

Thanks !
I'll look through it.
5H1N0B1
"Each day, with every person you meet, there is something to learn"
5H1N0B1
 
Posts: 211
Joined: Thu Aug 30, 2012 9:36 am
Location: France
Callsign: 5H1N0B1
IRC name: _5H1N0B1
Version: GIT
OS: Ubuntu

Re: HUD gyrocompass

Postby Octal450 » Tue Aug 20, 2019 5:58 pm

You can also use Richards clipping code. Essentially you can make an object with the region you want visible, name it the name of the object you are clipping with _clip, like HDGTape_clip and then his code will clip it automatically.

See my IDG MD-11 PFD for examples.

Kind Regards,
Josh
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: HUD gyrocompass

Postby 5H1N0B1 » Sun Oct 13, 2019 2:01 pm

Thanks a lot for your answers.
This is working great.
Image
5H1N0B1
"Each day, with every person you meet, there is something to learn"
5H1N0B1
 
Posts: 211
Joined: Thu Aug 30, 2012 9:36 am
Location: France
Callsign: 5H1N0B1
IRC name: _5H1N0B1
Version: GIT
OS: Ubuntu


Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest