Board index FlightGear Development Canvas

osgText backdrop

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.

Re: osgText backdrop

Postby TheTom » Sun Jul 27, 2014 12:00 pm

I've now pushed support for 'stroke' to simgear. I have not exposed 'stroke-width' as it is not really doing what it should do with SVG. With OSG it can only be set in percent of the avarage character height and instead of px like with SVG. And it is not a real outline, but instead uses a trick to just draw the text multiple times with different offsets. So the range of the 'stroke-width' property would be limited. To avoid too much confusion I thinks its better to leave it the way it is, and only add it if real outline is supported.
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: osgText backdrop

Postby Talkless » Sat Nov 08, 2014 3:31 pm

Gijs wrote in Mon Jul 07, 2014 4:29 pm:+ setBackdropColor: func me.set('backdrop', _getColor(arg)),


If I am not mistaken, it's not yet merged into master? I would use this functionality to to improve screen text visibility...
Talkless
 
Posts: 80
Joined: Thu Mar 10, 2011 12:05 pm
Callsign: TLS
Version: git master
OS: Linux

Re: osgText backdrop

Postby Gijs » Sun Nov 09, 2014 10:37 am

It is, but Tom changed the name a little, so the code from my post won't work. See https://gitorious.org/fg/simgear/commit ... f56fa2cbaf
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9386
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: osgText backdrop

Postby Talkless » Sun Nov 09, 2014 12:08 pm

Gijs wrote in Sun Nov 09, 2014 10:37 am:It is, but Tom changed the name a little, so the code from my post won't work. See https://gitorious.org/fg/simgear/commit ... f56fa2cbaf


That's great!

So in NASAL, I should use this?
Code: Select all
  setStroke: func(stroke)
  {
    me.set('stroke', stroke);
  },


And that stroke is a color?
Talkless
 
Posts: 80
Joined: Thu Mar 10, 2011 12:05 pm
Callsign: TLS
Version: git master
OS: Linux

Re: osgText backdrop

Postby Gijs » Sun Nov 09, 2014 1:01 pm

Yes, just use something like:
Code: Select all
.set('stroke', 'rgb(0,255,0)');


Not sure if Tom intentionally didn't add it to the Nasal API, as that would allow us to use something like:
Code: Select all
.setStroke(0,255,0);
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9386
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: osgText backdrop

Postby Talkless » Sun Nov 09, 2014 5:22 pm

Thank you Gijs, that helped. Though I am getting some kind strange rendering artefacts...
Talkless
 
Posts: 80
Joined: Thu Mar 10, 2011 12:05 pm
Callsign: TLS
Version: git master
OS: Linux

Previous

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest