Skip to main content
Question

Be able to show/hide shapes


Forum|alt.badge.img+1

Hello,

I would like to have a way to hide and show shapes. This will allow to write an app for something like layering.

 

I tried moving a shape into x=Number.maxNumber, which was good, as it was off the visible board, but then I get an error when I try to set it X value back to its original value. Something like it has no parent.

Any other ideas on how to do this? 

 

Thanks.

Was it helpful?

3 replies

Mettin
Mironeer
Forum|alt.badge.img+1
  • Mironeer
  • 86 replies
  • January 8, 2024

Hey @noam.arbel 

Maybe just using z index would be enough? Create a square that has the same color about your frame’s background, then move items around in your z-space using the `bringToFront`, `sendToFront` and `bringInFrontOf` methods that pretty much all board items have? I.e. here’s the docs for text->bringToFront() https://developers.miro.com/docs/websdk-reference-text#bringtofront

Hope this helps,

Cheers,
Mettin


Forum|alt.badge.img+1
  • Author
  • New Here
  • 1 reply
  • January 8, 2024

Yup, that is what I started to do. Not ideal but will do for now.


Mettin
Mironeer
Forum|alt.badge.img+1
  • Mironeer
  • 86 replies
  • January 8, 2024

Cool! If you’re building something like the photoshop layers panel you could also look into grouping things so you can .map over the items. Good luck!

https://developers.miro.com/docs/websdk-reference-group


Reply