MNGuiImage.DockFill
Skip to content
mnscript
MNGuiImage.DockFill() 

Description ​

Docks the element to fill.

Example ​

msc
using Surface;
using System;

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

// Creates four panels docked to the top, left, right and bottom
MNGuiPanel topPanel = Surface.CreatePanel(pnl);
topPanel.DockTop();

MNGuiPanel leftPanel = Surface.CreatePanel(pnl);
leftPanel.DockLeft();

MNGuiPanel rightPanel = Surface.CreatePanel(pnl);
rightPanel.DockRight();

MNGuiPanel bottomPanel = Surface.CreatePanel(pnl);
bottomPanel.DockBottom();

Color red = new Color(200,100,100,255);

// The filled panel will take up the remaining area in the center of the screen.
MNGuiPanel filledPanel = Surface.CreatePanel(pnl);
filledPanel.DockFill();
filledPanel.SetBackgroundColor(red);

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

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