diff --git a/proto/decentraland/sdk/components/ui_scroll_result.proto b/proto/decentraland/sdk/components/ui_scroll_result.proto new file mode 100644 index 00000000..df9b8814 --- /dev/null +++ b/proto/decentraland/sdk/components/ui_scroll_result.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package decentraland.sdk.components; + +import "decentraland/sdk/components/common/id.proto"; +import "decentraland/common/vectors.proto"; + +option (common.ecs_component_id) = 1202; + +message PBUiScrollResult { + decentraland.common.Vector2 value = 1; +} diff --git a/proto/decentraland/sdk/components/ui_transform.proto b/proto/decentraland/sdk/components/ui_transform.proto index 0e3c9f0c..2b6d548d 100644 --- a/proto/decentraland/sdk/components/ui_transform.proto +++ b/proto/decentraland/sdk/components/ui_transform.proto @@ -4,6 +4,7 @@ package decentraland.sdk.components; import "decentraland/sdk/components/common/id.proto"; import "decentraland/common/colors.proto"; +import "decentraland/common/vectors.proto"; option (common.ecs_component_id) = 1050; @@ -80,6 +81,20 @@ enum PointerFilterMode { PFM_BLOCK = 1; } +enum ShowScrollBar { + SSB_BOTH = 0; + SSB_ONLY_VERTICAL = 1; + SSB_ONLY_HORIZONTAL = 2; + SSB_HIDDEN = 3; +} + +message ScrollPositionValue { + oneof value { + decentraland.common.Vector2 position = 1; + string reference = 2; + } +} + message PBUiTransform { int32 parent = 1; int32 right_of = 2; @@ -174,5 +189,22 @@ message PBUiTransform { optional decentraland.common.Color4 border_right_color = 72; optional float opacity = 73; // default: 1 + + // Unique name for this UI element (HTML-`id`-like). Registered in a + // named-element table so other components/RPCs can refer to it: today + // consumed by ScrollPositionValue.reference (scroll a named child into view) + // and the UI focus RPC. default empty + optional string element_id = 74; + + // Scroll offset for this node's scroll viewport (only meaningful when + // overflow = YGO_SCROLL). Either a literal Vector2 position, or a string + // referencing another element's element_id to scroll into view. + // default position=(0,0) + optional ScrollPositionValue scroll_position = 75; + + // Which scroll bars to render when this node is scrollable. + // default ShowScrollBar.SSB_BOTH + optional ShowScrollBar scroll_visible = 76; + optional int32 z_index = 77; // default: 0 — controls render stacking order. Higher values appear in front of lower values. }