82 lines
1.9 KiB
Markdown
82 lines
1.9 KiB
Markdown
# UIMorphComponent.rotation
|
|
|
|
[← UIMorphComponent](index.md) · [← Master](../../wiki.md)
|
|
|
|
Parça 2/3 · [önceki](rotation.md) · [sonraki](rotation-3.md)
|
|
|
|
position
|
|
|
|
public UIMorphComponent position(float x,
|
|
float y,
|
|
float z)
|
|
|
|
Change camera's orbit position in the morph component. The default camera position (0, 1, 0).
|
|
|
|
ProTip: you can enable UI debug option in Ctrl + 0 > Mappet, you can position the morph after running the script, right click somewhere within its frame, and click Copy camera
|
|
information... context menu item. It will copy the configuration of camera, which you can paste into the code.
|
|
|
|
|
|
|
|
// Assuming that uiContext is a IMappetUIContext
|
|
|
|
// Set camera position
|
|
uiContext.get("morph").position(0, 1, 0.5);
|
|
|
|
|
|
rotation
|
|
|
|
public UIMorphComponent rotation(float pitch,
|
|
float yaw)
|
|
|
|
Change camera orbit rotation in the morph component. The default camera rotation (0, 0).
|
|
|
|
// Assuming that uiContext is a IMappetUIContext
|
|
|
|
// Set camera rotation
|
|
uiContext.get("morph").rotation(15, 0);
|
|
|
|
|
|
distance
|
|
|
|
public UIMorphComponent distance(float distance)
|
|
|
|
Change camera distance from camera orbit position in the morph component. The default camera distance is 2.
|
|
|
|
// Assuming that uiContext is a IMappetUIContext
|
|
|
|
// Set camera distance
|
|
uiContext.get("morph").distance(4);
|
|
|
|
|
|
fov
|
|
|
|
public UIMorphComponent fov(float fov)
|
|
|
|
Change camera Field of View in the morph component. The default FOV is 70.
|
|
|
|
// Assuming that uiContext is a IMappetUIContext
|
|
|
|
// Set camera FOV
|
|
uiContext.get("morph").fov(50);
|
|
|
|
|
|
getDefaultUpdateDelay
|
|
|
|
protected int getDefaultUpdateDelay()
|
|
|
|
Overrides:
|
|
getDefaultUpdateDelay in class UIComponent
|
|
|
|
applyProperty
|
|
|
|
protected void applyProperty(UIContext context,
|
|
java.lang.String key,
|
|
GuiElement element)
|
|
|
|
Overrides:
|
|
applyProperty in class UIComponent
|
|
|
|
create
|
|
|
|
public GuiElement create(Minecraft mc,
|