Phase 6 updates

Phase 6 · Slice 27 ·

UI Toolkit input controls

  • Keyboard: this frame's key events (without taking them from IMGUI) go to the focused element as KeyDownEvents; unless stopped, Tab and Shift+Tab move the focus in tab order, arrows send NavigationMoveEvent, Return NavigationSubmitEvent (buttons click, toggles flip), Escape NavigationCancelEvent.
  • TextField (TextInputBaseField): Unity's structure (TextInput and its inner text element), the caret and selection drawn over the text, typed characters, Backspace, Delete, arrows with Shift and word steps, Home, End, Ctrl+A, C, X, V, clicking and dragging to place and select, double click for a word; password masking, maxLength (it cuts the text, not the value, as in Unity), isDelayed, readonly. As in Unity, key events a script sends don't edit.
  • Slider, SliderInt (BaseSlider: low and high values clamping with change events, page size, direction, inverted, fill), RepeatButton, Scroller (Unity's ScrollerSlider), and ScrollView's scrollers, shown when the content outgrows the viewport and moving with it. Draggers are placed by a translation after layout, as Unity places them.
  • Drawing: rounded corners for backgrounds and borders (rows one screen pixel high through the corners; radii fitted as CSS fits them).
  • The default theme now has Unity's runtime values for text inputs, sliders, trackers, draggers and scrollers. The unity-disabled class marks only the element disabled itself (its children are just :disabled).
  • Checked by ui_toolkit_controls (6000.3): structures, defaults, values, clamping and events, keyboard events, scrollers, focus, and the theme's styles. The sample (ui_toolkit.json) shows rounded corners, a text field and a slider.
  • Not yet: transitions, transforms (translate, rotate, scale styles), numeric fields (IntegerField, FloatField), IME composition.
  • Next: UI Toolkit transitions and transform styles; CompositeCollider2D.offsetDistance; the executable's icon.