60 lines
1.8 KiB
Markdown
60 lines
1.8 KiB
Markdown
# UILayoutComponent — giriş
|
|
|
|
[← UILayoutComponent](index.md) · [← Master](../../wiki.md)
|
|
|
|
Parça 1/2 · [sonraki](_giris-2.md)
|
|
|
|
mchorse.mappet.api.ui.components
|
|
|
|
Class UILayoutComponent
|
|
java.lang.Object
|
|
|
|
mchorse.mappet.api.ui.components.UIComponent
|
|
mchorse.mappet.api.ui.components.UIParentComponent
|
|
|
|
mchorse.mappet.api.ui.components.UILayoutComponent
|
|
|
|
public class UILayoutComponent
|
|
extends UIParentComponent
|
|
|
|
Layout UI component.
|
|
|
|
This UI component does nothing, beside managing placement of other components. Layout UI component have three different modes upon which child components can be placed: column,
|
|
row, and grid.
|
|
|
|
Additionally, column mode supports scrolling when there are too many components within its frame.
|
|
|
|
This component can be created using IMappetUIBuilder.layout(), IMappetUIBuilder.column(int), IMappetUIBuilder.row(int), and IMappetUIBuilder.grid(int) methods.
|
|
|
|
function main(c)
|
|
{
|
|
var ui = mappet.createUI().background();
|
|
var column = ui.column(4, 10);
|
|
|
|
column.getCurrent().scroll().rxy(0.5, 0.5).w(240).rh(0.8).anchor(0.5);
|
|
|
|
var row = column.row(5);
|
|
var name = row.column(4);
|
|
|
|
name.label("Name").h(8);
|
|
name.textbox().id("name").h(20);
|
|
|
|
var lastname = row.column(4);
|
|
|
|
lastname.label("Last name").h(8);
|
|
lastname.textbox().id("lastname").h(20);
|
|
|
|
column.toggle("I agree to ToS").id("toggle").h(14);
|
|
column.text("The terms of service are following: you agree that your data will be used by an AI to generate funny cat and dog videos based entirely on your name and lastname.\n\nYou also agree to give us your time to view those videos, because we said so.").color(0xaaaaaa, false).marginTop(8);
|
|
column.button("Oh... a button?").h(20).marginTop(12);
|
|
|
|
c.getSubject().openUI(ui);
|
|
}
|
|
|
|
|
|
Field Summary
|
|
Fields
|
|
|
|
Modifier and Type Field and Description
|
|
boolean horizontal
|