Files

42 lines
1.8 KiB
Markdown

# UIMorphComponent — giriş
[← UIMorphComponent](index.md) · [← Master](../../wiki.md)
Parça 1/2 · [sonraki](_giris-2.md)
mchorse.mappet.api.ui.components
Class UIMorphComponent
java.lang.Object
mchorse.mappet.api.ui.components.UIComponent
mchorse.mappet.api.ui.components.UIMorphComponent
public class UIMorphComponent
extends UIComponent
Morph UI component.
This component allows to display a morph. Users can inspect it, but it can also be edited, if configured. If you want disable users to turn around the morph by disabling user input using
UIComponent.enabled(boolean).
If this component is editable, then the value that gets written to UI context's data (if ID is present) is an NBT compound tag that represents a morph.
This component can be created using IMappetUIBuilder.morph(AbstractMorph) method.
function main(c)
{
var ui = mappet.createUI().background();
var layout = ui.layout();
layout.getCurrent().rx(0.5).ry(1).wh(300, 100).anchor(0.5, 1);
var steve = mappet.createMorph("{CustomPose:{Size:[0.6f,1.8f,0.6f],Poses:{right_arm:{P:[-6.0f,-2.0f,0.0f],R:[-83.0f,41.0f,0.0f]},left_leg:{P:[2.0f,-12.0f,0.0f]},right_armwear:{P:[0.0f,-4.0f,0.0f]},outer:{P:[0.0f,4.0f,0.0f]},left_legwear:{P:[0.0f,-6.0f,0.0f]},body:{P:[0.0f,8.0f,0.0f]},bodywear:{P:[0.0f,-6.0f,0.0f]},head:{P:[0.0f,8.0f,0.0f],R:[18.0f,0.0f,9.0f]},left_arm:{P:[6.0f,-2.0f,0.0f]},right_leg:{P:[-2.0f,-12.0f,0.0f]},right_legwear:{P:[0.0f,-6.0f,0.0f]},anchor:{P:[0.0f,16.0f,0.0f]},left_armwear:{P:[0.0f,-4.0f,0.0f]}}},Settings:{Hands:1b},Name:\"blockbuster.fred\"}");
var morph = layout.morph(steve);
morph.position(-0.019, 1.5, 0).rotation(-11, 24).distance(1.6).fov(40);
morph.enabled(false).wh(100, 100);
var label = layout.label("Steve").background(0xaa000000);