Add background color to Canvas _txt : feature request

Let Sim Innovations know about your Air Manager experience and let us know about your dream feature addition

Moderators: russ, Ralph

Message
Author
User avatar
Corjan
Posts: 2941
Joined: Thu Nov 19, 2015 9:04 am

Re: Add background color to Canvas _txt : feature request

#11 Post by Corjan »

Keith Baxter wrote: Fri Jul 05, 2019 7:57 pm Corjan,

Can we please have opacity for..
_fill("red",0.8)

Keith
This already works?

Corjan

User avatar
Sling
Posts: 5241
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Add background color to Canvas _txt : feature request

#12 Post by Sling »

Yep, opacity already works but I don’t think it’s documented on the wiki. Be careful using this though as you also have canvas opacity that will effect the txt. I find it better to put all the txt on a canvas and use opacity on the canvas.

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Add background color to Canvas _txt : feature request

#13 Post by Keith Baxter »

Sling wrote: Fri Jul 05, 2019 10:52 pm Yep, opacity already works but I don’t think it’s documented on the wiki. Be careful using this though as you also have canvas opacity that will effect the txt. I find it better to put all the txt on a canvas and use opacity on the canvas.
Corjan, Tony,

Correct, not in the wiki.

Tony I am trying to get an annuator to light up. So I want to put a red on top of a yellow.

Any ideas on how to get the best effect?

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Sling
Posts: 5241
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Add background color to Canvas _txt : feature request

#14 Post by Sling »

Keith,

Do you mean a dual colour annunciatior that can be either red or yellow. Also assuming you want to do this with canvas right?

You just need an if else that either draws in red or yellow. I doubt you’ll need opacity. You must call the draw function every time the annunciation state changes so it redraws correctly each time.

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Add background color to Canvas _txt : feature request

#15 Post by Keith Baxter »

Sling wrote: Sat Jul 06, 2019 4:28 am Keith,

Do you mean a dual colour annunciatior that can be either red or yellow. Also assuming you want to do this with canvas right?

You just need an if else that either draws in red or yellow. I doubt you’ll need opacity. You must call the draw function every time the annunciation state changes so it redraws correctly each time.
Tony,
Correct.
With regards to the annunciator I am doing what you say.
Regarding Opacity, I am using to darken the panel for night vision. So when the sun go's down the MIP gets darker. I use opacity to darken the panel.

Will post a vid clip on what I am doing later today. It is coming along quite nicely.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Sling
Posts: 5241
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Add background color to Canvas _txt : feature request

#16 Post by Sling »

Oh ok that sounds like a similar method as my panel lighting. I would still use canvas opacity rather than txt though.

Tony

SimPassion
Posts: 5346
Joined: Thu Jul 27, 2017 12:22 am

Re: Add background color to Canvas _txt : feature request

#17 Post by SimPassion »

Hello Keith

try using a black bitmap overlay with transparency set to 50%
then varying opacity in AM from 0 to 1

Gilles

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Add background color to Canvas _txt : feature request

#18 Post by Keith Baxter »

Corjan wrote: Fri Jul 05, 2019 9:19 pm
Keith Baxter wrote: Fri Jul 05, 2019 7:57 pm Corjan,

Can we please have opacity for..
_fill("red",0.8)

Keith
This already works?

Corjan
Corjan,

Ok the fill works BUT _stroke does not. If I try and add opacity then the thickness of the line changes not the opacity.

Can you please add opacity to _stroke

Keith


EDIT:

The opacity does change BUT when using _arc() there is an issue.

test with this code and you will see what I mean.


Code: Select all

opasw=0.4
		_arc(242, 180,315,317,35)
		_stroke("#CDCDCD",25,opasw)	
		_arc(242, 180,270,272,35)
		_stroke("#CDCDCD",25)
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2941
Joined: Thu Nov 19, 2015 9:04 am

Re: Add background color to Canvas _txt : feature request

#19 Post by Corjan »

Hi,

Change it into "_stroke("#CDCDCD",opasw,25)" and you should be good.
I'll make sure to add this to the wiki.

Corjan

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Add background color to Canvas _txt : feature request

#20 Post by Keith Baxter »

Corjan wrote: Mon Jul 08, 2019 8:36 pm Hi,

Change it into "_stroke("#CDCDCD",opasw,25)" and you should be good.
I'll make sure to add this to the wiki.

Corjan
Thank you Corjan.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply