Created
August 28, 2020 21:53
-
-
Save flushpot1125/694cc1891953bfeddbb412778a890f2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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