Opacity changes to Groups & style to canvas

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

Moderators: russ, Ralph

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

Opacity changes to Groups & style to canvas

#1 Post by Keith Baxter »

Hi,

1) I want to be able to change the Opacity of a complete group. Thinking that the move() function could be used to do that.

Code: Select all

move(my_group, x,y,w,h,opacity)
Reason is to ghost one canvas on top of another without a redraw.

EDIT: I see that opacity(node_id, opacity) is available. Not sure it is working with canvas groups. Will revert after re-testing.

2) I want to change the _fill() or _stroke() style without redrawing the canvas. I did try and do this ...

Code: Select all

canvas_draw(my_canvas, function()
_rect(0,0,20,20)
_stroke("blue",2)
end)

--Changed my mind want he rect red and 5px

canvas_draw(my_canvas, function()
_stroke("red",5)
end)
And the whole canvas went to nil.

I am sure this option must be available in the canvas library.
Please check if possible and we can have that feature.


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: 5239
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Opacity changes to Groups & style to canvas

#2 Post by Sling »

Keith,

You can use opacity on a whole group. It was working but I haven’t checked recently. If it’s broke I’m sure it will be fixed.

The changing style without redrawing goes against how the canvas is used. However if you want to save having to redraw items that don”t need to change at all or together with other items then this can be handled by you. Meaning don’t put items that need to change independent from each other on the same canvas. Doing this means you just redraw the subset of items that change and not the items that do not.

Tony

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

Re: Opacity changes to Groups & style to canvas

#3 Post by Keith Baxter »

Tony,

Opacity() indeed does work with canvas(). My bad when testing i was using .05 instead of 0.5 causing a blank screen.

I will do a video later today to show just how long it takes to redraw a canvas and then it would be understood why I am asking for style changes to _fill() and _stroke().

I will be creating My own "font/symbol" set for icons using FontForge or PCE. This is to avoid loading thousands of .png images all over the canvas. BUT I would need to resize the font on zoom. Not sure how kindly AM is going to take to loading world waypoints the resizing dynamically. That remains to be investigated. But I think, if an indication of the OSM loading is anything to go by, then that might be a stretch too far.

I should have a bunch of flight plans loaded and will also show some airspaces and a few other things like major airports etc

ATM spending most of my time with the user interface.

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
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Opacity changes to Groups & style to canvas

#4 Post by Keith Baxter »

Hi,

Uploaded the video I promised, link in the Vector Map thread.

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
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Opacity changes to Groups & style to canvas

#5 Post by Keith Baxter »

Hi,

I had an awesome Skype chat with @Corjan today. When I say awesome, I am referring to and say....

Thank you for spending time to discuss and explain many things to me Corjan. This sort of privilege (Talking to the company programming guru) is extremely rare in all other application. I have a far better understanding of AM and what can and what cannot be done and the reasons.

What I request in this thread cannot be done and suggestions on how to achieve the end result were freely shared.

Three Key point emerged.

1) Don't redraw. This takes up CPU. Rather resize using move()
2) Only draw what is necessary for the view area.
3) Use visible() rather than redraw. If the canvas is not visible then it does not take up CPU resources.

I have done a lot more work on the map prior and since our chat. Next week I will have the AirSpaces working and an enhanced color picker. I was curious as to why "other" maps only showed AirSpaces at certain levels of zoom. All answered. It is just not possible to reiterate and draw all the Airspace polygons of a world canvas (At this time). Well you can draw it. Making it visible is another story. :D

Going to load the the flight plans this afternoon.

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
Ralph
Posts: 7924
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Opacity changes to Groups & style to canvas

#6 Post by Ralph »

We might have to start a Televangelism service that lets you talk to Corjan for 15 minutes if you pay €250 :lol:

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

Re: Opacity changes to Groups & style to canvas

#7 Post by Keith Baxter »

Ralph wrote: Sun Sep 20, 2020 1:03 pm We might have to start a Televangelism service that lets you talk to Corjan for 15 minutes if you pay €250 :lol:
LOL Ralph.

You guys provide an amazing service level with the few resources you have.

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
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Opacity changes to Groups & style to canvas

#8 Post by Keith Baxter »

Hi,

Oops I forgot to query,

On an off chance, Can we link sound() to a cursor?
Like when scrolling up in a scroll wheel, play a sound clip. "scrolling up" or when you are about to press a button play " Pressing this button will zoom your map in". I think that explains my query.

Note :mrgreen: It is NOT "requests" any more but "query".

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
jph
Posts: 2856
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Opacity changes to Groups & style to canvas

#9 Post by jph »

Ralph wrote: Sun Sep 20, 2020 1:03 pm We might have to start a Televangelism service that lets you talk to Corjan for 15 minutes if you pay €250 :lol:
I commend the notion but it must include all groups...
But, what if someone is a dyslexic agnostic insomniac who lays awake at night wondering if there really is a dog.... ?

Maybe a web cam at night and a pay per minute service ? - no stockings though :o ........... ;)
Joe. CISSP, MSc.

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

Re: Opacity changes to Groups & style to canvas

#10 Post by Keith Baxter »

Hi @Corjan

I did request _stroke() styles in another thread. This link http://docs.oracle.com/cd/E17802_01/jav ... ssref.html from http://siminnovations.com/wiki/index.ph ... _txt_layer Arguments #4 styl, attracted my attention.

I am talking about this bit of code in "Examples". What is interesting here is not only the dashes line but that a _fill() and _stroke() are used for the same _rect(). I thought that worked this way at one point then it did not. I might be mistaken.

Code: Select all

.my-rect {
    -fx-fill: yellow;
    -fx-stroke: green;
    -fx-stroke-width: 5;
    -fx-stroke-dash-array: 12 2 4 2;
    -fx-stroke-dash-offset: 6;
    -fx-stroke-line-cap: butt;
}
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