Skip to content

Problem in using helpText #24

Closed Answered by jessegreenberg
sadrajafari asked this question in Q&A
Discussion options

You must be logged in to vote

I am not aware of a Tooltip component in SceneryStack, but you could make your own with scenery like this:

// Set up the scenery Display.
const rootNode = new phet.scenery.Node();
const display = new phet.scenery.Display( rootNode );
document.body.appendChild( display.domElement );

// A reusable class that creates a tooltip. It is initially invisible and becomes visible when you mouse over a circle.
// It combines scenery Text and Rectangle Nodes to render something that looks like a tooltip.
class Tooltip extends phet.scenery.Node {
  constructor( text ) {
    super();

    this.visible = false;

    // The text of the tooltip
    const tooltipText = new phet.scenery.Text( text, {
      

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@sadrajafari
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by sadrajafari
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants