Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created August 28, 2020 21:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
import {AdvancedDynamicTexture,TextBlock,StackPanel} from "@babylonjs/gui";
public onStart(): void {
const playerUI = AdvancedDynamicTexture.CreateFullscreenUI("UI");
const stackPanel = new StackPanel();
stackPanel.height = "100%";
stackPanel.width = "100%";
stackPanel.top = "14px";
stackPanel.verticalAlignment = 0;
playerUI.addControl(stackPanel);
const blockCount = new TextBlock();
blockCount.name = "clock";
blockCount.textHorizontalAlignment = TextBlock.HORIZONTAL_ALIGNMENT_CENTER;
blockCount.fontSize = "48px";
blockCount.color = "white";
blockCount.text = "blocks 0/8";
blockCount.resizeToFit = true;
blockCount.height = "96px";
blockCount.width = "220px";
blockCount.fontFamily = "Viga";
stackPanel.addControl(blockCount);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment