Board index FlightGear Development Canvas

possible transparency bug  Topic is solved

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.

possible transparency bug

Postby Necolatis » Thu Feb 21, 2013 4:22 pm

Not sure if I use this the right way, but:

If I make a vertical path (non-liniar) A

and make a horizontal path (non-liniar) B

I make A transparent, B opaque.

I make them cross each other.

Part of A that is close to B, will now be visible.

Btw. are there easier ways of switch something like a path or text on and off, beside using the transparency in setColor()?
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2118
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: possible transparency bug  

Postby TheTom » Thu Feb 21, 2013 4:49 pm

I will have a look at this.

Necolatis wrote in Thu Feb 21, 2013 4:22 pm:Btw. are there easier ways of switch something like a path or text on and off, beside using the transparency in setColor()?

You can either set "visible" to the according value or use the hide/show methods:

Code: Select all
# hide:
path.setBool("visible", 0);
path.hide();

# show:
path.setBool("visible", 1);
path.show();

# toggle
path.setBool("visible", !path.getBool("visible")); # (maybe it's time for a toggleBool method...)
path.toggleVisibility();
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 10:20 am

Re: possible transparency bug

Postby Necolatis » Thu Feb 21, 2013 5:04 pm

Thanks. :)

Yeah, have made some blinking stuff, and 2 diff. cross hairs in my HUD, so need to show and hide many times.

How about an autoblink function?

path.blink(interval);
path.blink(interval, fade);
path.blink(interval, fade, duration);

:)
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2118
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: possible transparency bug

Postby TheTom » Sun Feb 24, 2013 9:26 pm

Necolatis wrote in Thu Feb 21, 2013 5:04 pm:How about an autoblink function?

I think it would be better to create a function which can animate any property. Maybe something like:

Code: Select all
# visible is a boolean property which should be toggled
# between 0 and 1 every 500ms
el.animate("visible", 0, 1, 500, {"repeat": 1});


Maybe we can also support interpolating eg. color and also stop running animations. Lots of possibilities :P
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 10:20 am

Re: possible transparency bug

Postby Necolatis » Tue Feb 26, 2013 9:47 pm

Yes, would be nice.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2118
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10


Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest