Jump to content

Canvas2d - changing visibility at run/render time


touslecoq
 Share

Recommended Posts

Hi folks, @Nockawa

As well as making use of the fine Castor.js extension for html based UI, I am wanting to add some webgl UI elements using Canvas2d, specifically mesh labels.

I have pretty much got to grips with the basics.  However one thing I cannot get to work is changing the visibility of elements at run time. For example allowing the user to toggle labels on and off.

I have created a silly demo based on the "labels" playground demo.  The red sphere has a label.  Hitting the 'Z' and 'X' keys moves the label along the viewport x-axis and this works fine.  The ''L' key toggles the .isVisible property of the label but has no effect.  Note that this property does work at 'create' time.  If you change line 5 to default to 'false' then the label will not be displayed.  However then hitting 'L' key does not display it.  The key events write to the console log so it looks as though the events are triggering.

http://www.babylonjs-playground.com/#1RB7WB#20

Am I doing something wrong or is the isVisible not re-read once created?

Thanks

Richard

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...