Layer Issues

Ian SooHoo shared this question 2 years ago
Answered

Let's say I want to display some text over a bar chart. I use a rectangle to cover the chart on layer 2 and put the text object on layer 3. I use a button to toggle it "onclick" I run the GGBScript command "SetVisibleInView(Textobject,3,true)" and "SetVisibleInView(rectangle,2,true)". For me, nothing happens. I also set, under the text and rectangle object's settings advanced>Misc>correct layer. Is there something I'm doing wrong?


EDIT: I assume "View Number" meant layer number. Is this not correct? What is the view number then?

Comments (6)

photo
1

Please check this file by Chris Cambre, that shows a nice way to display texts.

Or post your file, because it's not possible to troubleshoot a post ;)

photo
1

Well this is more of a comment about GGBScript rather than a specific file since I hope to use layering all the time. I believe I figured out what 1 and 2 are, they don't stand for layers but for the graphics views

photo
1

This is the command for layers:


https://wiki.geogebra.org/e...

photo
1

Here's a wishlist item.

I would like the layer that I choose in the object properties>advanced>layer dropdown to stick to whatever I set it to so that subsequent objects placed in that layer.

Currently, objects are always placed in the highest layer used in the diagram, but can be changed to other layers in settings or with this command.

photo
1

This is possible with a small JS-script in global-JS.

But it would be better built this in fix at GGB.

Instead of the drop-down lists, the last assigned level would be also a valable variant (for me).

photo
1

Thanks!

photo
© 2021 International GeoGebra Institute