38 lines
970 B
Markdown
38 lines
970 B
Markdown
# IMappetUIContext — giriş
|
|
|
|
[← IMappetUIContext](index.md) · [← Master](../../wiki.md)
|
|
|
|
mchorse.mappet.api.scripts.user.mappet
|
|
|
|
Interface IMappetUIContext
|
|
|
|
public interface IMappetUIContext
|
|
|
|
This interface represents an UI context, which is an object that stores UI data when player has opened custom GUI
|
|
made with IMappetUIBuilder.
|
|
|
|
It's usually available after the UI has been sent using IScriptPlayer.openUI(IMappetUIBuilder) in the handler function.
|
|
|
|
function main(c)
|
|
{
|
|
var ui = mappet.createUI(c, "handler").background();
|
|
var button = ui.button("Push me").id("button");
|
|
|
|
// Place a button in the middle of the screen
|
|
button.rxy(0.5, 0.5).wh(80, 20).anchor(0.5);
|
|
c.getSubject().openUI(ui);
|
|
}
|
|
|
|
function handler(c)
|
|
{
|
|
var uiContext = c.getSubject().getUIContext();
|
|
|
|
// Do something with UI context...
|
|
}
|
|
|
|
|
|
Method Summary
|
|
All Methods Instance Methods Abstract Methods
|
|
|
|
Modifier and Type Method and Description
|