Closed leanmendoza closed 1 year ago
It might be a SDK problem, while debugging the model received by the renderer, they're not the same.
[
{
"widthUnit": "YGU_POINT",
"width": 300,
"marginLeftUnit": "YGU_POINT",
"marginLeft": 245,
"marginTopUnit": "YGU_POINT",
"marginTop": 70,
"paddingLeftUnit": "YGU_POINT",
"paddingLeft": 10,
"paddingTopUnit": "YGU_POINT",
"paddingTop": 10,
"paddingRightUnit": "YGU_POINT",
"paddingRight": 10,
"paddingBottomUnit": "YGU_POINT",
"paddingBottom": 10
},
{
"parent": 516,
"rightOf": 513,
"alignItems": "YGA_CENTER",
"justifyContent": "YGJ_CENTER",
"widthUnit": "YGU_PERCENT",
"width": 100,
"paddingBottomUnit": "YGU_PERCENT"
},
{
"parent": 515,
"paddingBottomUnit": "YGU_PERCENT"
},
{
"parent": 516,
"alignItems": "YGA_CENTER",
"justifyContent": "YGJ_CENTER",
"widthUnit": "YGU_PERCENT",
"width": 100,
"paddingBottomUnit": "YGU_PERCENT"
},
{
"parent": 513,
"paddingBottomUnit": "YGU_PERCENT"
}
]
[
{
"alignContent": "YGA_FLEX_START",
"alignItems": "YGA_FLEX_START",
"flexWrap": "YGW_WRAP",
"alignSelf": "YGA_FLEX_START",
"widthUnit": "YGU_POINT",
"width": 300,
"marginLeftUnit": "YGU_POINT",
"marginLeft": 245,
"marginTopUnit": "YGU_POINT",
"marginTop": 70,
"paddingLeftUnit": "YGU_POINT",
"paddingLeft": 10,
"paddingTopUnit": "YGU_POINT",
"paddingTop": 10,
"paddingRightUnit": "YGU_POINT",
"paddingRight": 10,
"paddingBottomUnit": "YGU_POINT",
"paddingBottom": 10
},
{
"parent": 516,
"rightOf": 513,
"alignContent": "YGA_FLEX_START",
"alignItems": "YGA_CENTER",
"flexWrap": "YGW_WRAP",
"alignSelf": "YGA_FLEX_START",
"justifyContent": "YGJ_CENTER",
"widthUnit": "YGU_PERCENT",
"width": 100
},
{
"parent": 515,
"alignContent": "YGA_FLEX_START",
"alignItems": "YGA_FLEX_START",
"flexWrap": "YGW_WRAP",
"alignSelf": "YGA_FLEX_START"
},
{
"parent": 516,
"alignContent": "YGA_FLEX_START",
"alignItems": "YGA_CENTER",
"flexWrap": "YGW_WRAP",
"alignSelf": "YGA_FLEX_START",
"justifyContent": "YGJ_CENTER",
"widthUnit": "YGU_PERCENT",
"width": 100
},
{
"parent": 513,
"alignContent": "YGA_FLEX_START",
"alignItems": "YGA_FLEX_START",
"flexWrap": "YGW_WRAP",
"alignSelf": "YGA_FLEX_START"
}
]
[
{
+ "alignContent": "YGA_FLEX_START",
+ "alignItems": "YGA_FLEX_START",
+ "flexWrap": "YGW_WRAP",
+ "alignSelf": "YGA_FLEX_START",
"widthUnit": "YGU_POINT",
"width": 300,
"marginLeftUnit": "YGU_POINT",
"marginLeft": 245,
"marginTopUnit": "YGU_POINT",
"marginTop": 70,
"paddingLeftUnit": "YGU_POINT",
"paddingLeft": 10,
"paddingTopUnit": "YGU_POINT",
"paddingTop": 10,
"paddingRightUnit": "YGU_POINT",
"paddingRight": 10,
"paddingBottomUnit": "YGU_POINT",
"paddingBottom": 10
},
{
"parent": 516,
"rightOf": 513,
+ "alignContent": "YGA_FLEX_START",
"alignItems": "YGA_CENTER",
+ "flexWrap": "YGW_WRAP",
+ "alignSelf": "YGA_FLEX_START",
"justifyContent": "YGJ_CENTER",
"widthUnit": "YGU_PERCENT",
"width": 100,
- "paddingBottomUnit": "YGU_PERCENT"
},
{
"parent": 515,
+ "alignContent": "YGA_FLEX_START",
+ "alignItems": "YGA_FLEX_START",
+ "flexWrap": "YGW_WRAP",
+ "alignSelf": "YGA_FLEX_START",
- "paddingBottomUnit": "YGU_PERCENT"
},
{
"parent": 516,
+ "alignContent": "YGA_FLEX_START",
"alignItems": "YGA_CENTER",
+ "flexWrap": "YGW_WRAP",
+ "alignSelf": "YGA_FLEX_START",
"justifyContent": "YGJ_CENTER",
"widthUnit": "YGU_PERCENT",
"width": 100,
- "paddingBottomUnit": "YGU_PERCENT"
},
{
"parent": 513,
+ "alignContent": "YGA_FLEX_START",
+ "alignItems": "YGA_FLEX_START",
+ "flexWrap": "YGW_WRAP",
+ "alignSelf": "YGA_FLEX_START",
- "paddingBottomUnit": "YGU_PERCENT"
}
]
[
{
+ "alignContent": "YGA_FLEX_START",
+ "alignItems": "YGA_FLEX_START",
+ "flexWrap": "YGW_WRAP",
+ "alignSelf": "YGA_FLEX_START",
},
{
+ "alignContent": "YGA_FLEX_START",
+ "flexWrap": "YGW_WRAP",
+ "alignSelf": "YGA_FLEX_START",
- "paddingBottomUnit": "YGU_PERCENT"
},
{
+ "alignContent": "YGA_FLEX_START",
+ "alignItems": "YGA_FLEX_START",
+ "flexWrap": "YGW_WRAP",
+ "alignSelf": "YGA_FLEX_START",
- "paddingBottomUnit": "YGU_PERCENT"
},
{
+ "alignContent": "YGA_FLEX_START",
+ "flexWrap": "YGW_WRAP",
+ "alignSelf": "YGA_FLEX_START",
- "paddingBottomUnit": "YGU_PERCENT"
},
{
+ "alignContent": "YGA_FLEX_START",
+ "alignItems": "YGA_FLEX_START",
+ "flexWrap": "YGW_WRAP",
+ "alignSelf": "YGA_FLEX_START",
- "paddingBottomUnit": "YGU_PERCENT"
}
]
In the current @next version (explorer=dev, js-sdk-toolchain=main) the UI is not working as expected. The code syntax changed a bit, but the same code can be rewritten, in the next two snippets the
Latest version
is the one that works fine.Current version
Run
button:function getPlayerPosition() { const playerPosition = Transform.getOrNull(engine.PlayerEntity) if (!playerPosition) return '' const { x, y, z } = playerPosition.position return
{x: ${x.toFixed(2)}, y: ${y.toFixed(2)}, z: ${z.toFixed(2)} }
}ReactEcsRenderer.setUiRenderer(uiComponent)