How to use the babylonjs-gui.Rectangle function in babylonjs-gui

To help you get started, we’ve selected a few babylonjs-gui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BabylonJS / Editor / src / editor / tools / default-scene.ts View on Github external
public static CreateLabel (gui: AdvancedDynamicTexture, mesh: Mesh, str: string, lines: boolean, width: string, height: string): Rectangle {
        // PBR GUI
        const label = new Rectangle(str);
        label.background = 'black'
        label.height = height;
        label.alpha = 0.5;
        label.width = width;
        label.cornerRadius = 20;
        label.thickness = 1;
        label.linkOffsetY = 30;
        label.top = '0%';
        label.zIndex = 5;
        label.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
        label.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_RIGHT;
        gui.addControl(label);

        const text = new TextBlock();
        text.text = str;
        text.color = 'white';
github brianzinn / react-babylonjs / src / Rectangle.ts View on Github external
create(scene: Scene): BabylonRectangle {
    this.rectangle = new BabylonRectangle(this.props.name)

    return this.rectangle
  }