Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static createCoordinatesText(guiTexture: GUI.AdvancedDynamicTexture): { txtX: GUI.TextBlock, txtY: GUI.TextBlock, txtZ: GUI.TextBlock } {
let txtX = new GUI.TextBlock();
txtX.height = "20px";
txtX.width = "500px";
txtX.fontSize = 20;
txtX.text = "X: ";
txtX.textHorizontalAlignment = GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
txtX.textVerticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_TOP;
txtX.horizontalAlignment = GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
txtX.verticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_TOP;
txtX.left = 20;
txtX.top = 60;
let txtY = new GUI.TextBlock();
txtY.height = "20px";
txtY.width = "500px";
txtY.fontSize = 20;
txtY.text = "Y: ";
txtY.textHorizontalAlignment = GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
txtY.textVerticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_TOP;
txtY.horizontalAlignment = GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
txtY.verticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_TOP;
txtY.left = 20;
txtY.top = 90;
let txtZ = new GUI.TextBlock();
React.useEffect(() => {
textBlock = new GUI.TextBlock('lines_text', props.stdoutLines.join('\n'));
textBlock.textWrapping = true;
textBlock.textHorizontalAlignment = GUI.Control.HORIZONTAL_ALIGNMENT_LEFT
textBlock.textVerticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_TOP
textBlock.fontFamily = "Consolas"
textBlock.color = "#00FF00"
textBlock.fontSize = 100
const padding = 15
textBlock.paddingTop = padding
textBlock.paddingRight = padding
textBlock.paddingBottom = padding
textBlock.paddingLeft = padding
return stopCursorInterval
}, [])
React.useEffect(() => {
textBlock = new GUI.TextBlock('lines_text', props.stdoutLines.join('\n'));
textBlock.textWrapping = true;
textBlock.textHorizontalAlignment = GUI.Control.HORIZONTAL_ALIGNMENT_LEFT
textBlock.textVerticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_TOP
textBlock.fontFamily = "Consolas"
textBlock.color = "#00FF00"
textBlock.fontSize = 100
const padding = 15
textBlock.paddingTop = padding
textBlock.paddingRight = padding
textBlock.paddingBottom = padding
textBlock.paddingLeft = padding
return stopCursorInterval
}, [])
public static createButtonSwim(guiTexture: GUI.AdvancedDynamicTexture, btnText: string, btnClicked: (button: GUI.Button) => void) {
let btnTest = GUI.Button.CreateSimpleButton("but1", btnText);
btnTest.width = "150px";
btnTest.height = "40px";
btnTest.color = "white";
btnTest.background = "grey";
btnTest.onPointerUpObservable.add(() => {
if (btnClicked) {
btnClicked(btnTest);
}
});
btnTest.horizontalAlignment = GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
btnTest.verticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_TOP;
btnTest.left = 12;
btnTest.top = 12;
guiTexture.addControl(btnTest);
}