Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions proto/decentraland/sdk/components/touch_screen_controls.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
syntax = "proto3";
package decentraland.sdk.components;
import "decentraland/sdk/components/common/id.proto";
import "decentraland/sdk/components/common/input_action.proto";
import "decentraland/common/texture.proto";
option (common.ecs_component_id) = 1218;

// The TouchScreenControls component lets a scene configure the native on-screen touch
// controls (the mobile joystick + gamepad). It must be set on the RootEntity.
//
// By default every on-screen button is shown; list a button in `touch_inputs` with
// `hide = true` to remove it (declutter). `main_action` picks which action the large
// central button triggers, and `hide_joystick` removes the native virtual joystick. It is
// a no-op on platforms without native on-screen controls (e.g. desktop).
//
// Accepted actions: only the on-screen gamepad actions map to a button — `IA_POINTER`,
// `IA_PRIMARY`, `IA_SECONDARY`, `IA_JUMP`, and `IA_ACTION_3`..`IA_ACTION_6`. Any other
// `InputAction` (movement actions, `IA_ANY`, `IA_MODIFIER`, or unknown/future values) is
// ignored: a `TouchInput` entry naming a non-button action has no effect, and a `main_action`
// that isn't a valid gamepad action falls back to the default central button (`IA_JUMP`).
message PBTouchScreenControls {
// Per-button configuration. A button not listed here keeps its default (shown).
message TouchInput {
common.InputAction input_action = 1; // which on-screen button this configures
bool hide = 2; // hide this button (default: shown)
// Override the button glyph with this texture. For the jump button it replaces all
// of its dynamic states (jump / double-jump / glide).
optional decentraland.common.TextureUnion icon = 3;
}

repeated TouchInput touch_inputs = 1;
// The large central button's action. Only the gamepad actions are valid:
// jump / pointer / primary (E) / secondary (F) / action_3..action_6 (1/2/3/4).
// When unset, the default central button (jump) is kept.
optional common.InputAction main_action = 2;
bool hide_joystick = 3; // hide the native virtual joystick
bool hide_crosshair = 4; // hide the on-screen crosshair / reticle
}
27 changes: 27 additions & 0 deletions proto/decentraland/sdk/components/ui_input_binding.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
syntax = "proto3";
package decentraland.sdk.components;
import "decentraland/sdk/components/common/id.proto";
import "decentraland/sdk/components/common/input_action.proto";
option (common.ecs_component_id) = 1219;

// The UiInputBinding component binds a UI entity to one or more InputActions. While the
// element is pressed (touch or pointer) the listed actions are held down, driving both
// the local player input and scene InputAction listeners, just like the native on-screen
// buttons. It is typically combined with PBTouchScreenControls to replace the native
// controls with a custom touch UI.
//
// Release semantics: the held actions are released as soon as the press that started them
// ends. A renderer MUST release all actions held by this binding when any of the following
// happens: the press/touch is lifted or cancelled, the pointer/touch leaves the element
// (loses press ownership), the actions list changes (the previous set is released before
// the new set is applied), the component is removed or its actions list becomes empty, the
// UI element is hidden, disabled or removed from the tree, or the scene unloads. In short,
// no action may remain held once the element is no longer both present and actively pressed.
//
// Multi-touch: the binding is a single held state, not reference-counted per pointer. The
// actions are held while the element is pressed and released when that press ends; a second
// simultaneous press on the same element does not stack, and does not extend the hold past
// the first release.
message PBUiInputBinding {
repeated common.InputAction actions = 1; // the input actions fired while this element is pressed
}
2 changes: 2 additions & 0 deletions proto/decentraland/sdk/components/virtual_camera.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ option (common.ecs_component_id) = 1076;
// an 'instant' transition (like using speed/time = 0)
// * The lookAtEntity defines to which entity the Camera has to look at constantly (independent from
// the holding entity transform).
// * The fov defines the Field of View of the virtual camera
message PBVirtualCamera {
optional common.CameraTransition default_transition = 1;
optional uint32 look_at_entity = 2;
optional float fov = 3; // default: 60
}
2 changes: 2 additions & 0 deletions public/sdk-components.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import public "decentraland/sdk/components/raycast_result.proto";
import public "decentraland/sdk/components/raycast.proto";
import public "decentraland/sdk/components/realm_info.proto";
import public "decentraland/sdk/components/text_shape.proto";
import public "decentraland/sdk/components/touch_screen_controls.proto";
import public "decentraland/sdk/components/tween.proto";
import public "decentraland/sdk/components/tween_state.proto";
import public "decentraland/sdk/components/tween_sequence.proto";
Expand All @@ -37,6 +38,7 @@ import public "decentraland/sdk/components/ui_dropdown_result.proto";
import public "decentraland/sdk/components/ui_dropdown.proto";
import public "decentraland/sdk/components/ui_input_result.proto";
import public "decentraland/sdk/components/ui_input.proto";
import public "decentraland/sdk/components/ui_input_binding.proto";
import public "decentraland/sdk/components/ui_text.proto";
import public "decentraland/sdk/components/ui_transform.proto";
import public "decentraland/sdk/components/video_player.proto";
Expand Down
Loading