MNGuiLabel.SetFont
Skip to content
mnscript
MNGuiLabel.SetFont(string) 

Description ​

Sets the label font.

Arguments ​

string - The new font.

Example ​

msc
using Surface;
using System;

// Valid fonts:
// - default
// - code_pro
// - arial

MNGuiFrame frame = Surface.CreateApplicationFrame();
MNGuiPanel pnl = frame.GetPanel();

// Creates a label using Code Pro font.
MNGuiLabel label = Surface.CreateLabel(pnl);
label.DockFill();
label.SetText("Hello World!");
label.SetFont("code_pro");

// Update to add the new UI to the screen.
Surface.Update();

// Keep the program alive so the UI stays.
while(true){
    System.Sleep(1);
}