MNGuiFrame.SetPos
Skip to content
mnscript
MNGuiFrame.SetPos(number, number) 

Description ​

Sets the position of the UI element.

Arguments ​

number - The new X position.
number - The new Y position.

Example ​

msc
using Surface;
using System;

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

// DO NOT USE SETPOS UNLESS YOU HAVE TO.
// USE DOCKING INSTEAD, OR ELSE YOUR UI WILL NEVER SCALE TO ALL SCREENS PROPERLY.

// Creates a panel and offsets it by 10, 10 on x, y;
MNGuiPanel panel = Surface.CreatePanel(pnl);
panel.SetPos(10, 10);

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

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