Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created August 28, 2020 21:53
Show Gist options
  • Save flushpot1125/694cc1891953bfeddbb412778a890f2a to your computer and use it in GitHub Desktop.
Save flushpot1125/694cc1891953bfeddbb412778a890f2a to your computer and use it in GitHub Desktop.
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