UI Toolbox logoUI Toolbox
Support

| Parley.unity | ParleyController | A cut scene on a stone bridge at dusk: Borin Stone meets Grub the Cave Troll, who wants a toll. Black bars slide in, the speaker shows large and the listener dims. A DialogueBox types each line; the choices show on a ChoiceWheel with a tone color and icon each and the whole line of the highlighted one under the wheel, or, after the Wheel / List switch (V or the gamepad North button, also in the middle of a choice), in the ChoiceMenu of the box. 1-5 pick in both views. The temper of the troll is a StatBar with a floating change; Pay is locked with its reason until Borin can pay. When Grub swings, a ProgressRing runs out over "Strike first!": E or X in time wins the fight, and a miss plays the hurt clip of Borin and goes on. A banner and a card name the end, Crossed, Paid or Fought, with Play again. |

Example scenes

The scenes in Assets/UIToolbox/Examples/Scenes show other setups. Their files are in Assets/UIToolbox/Examples, in a folder for each scene. The helpers that several scenes use (SampleUI, SampleScreen, SampleNavigation and others) are in Shared. Each scene has one controller on its UI GameObject. The game examples and the data and tools examples each have a page that explains them step by step: see Example scenes in the contents, for example Crypt.

Scene Controller Shows
Units.unity UnitsController An RTS field of 240 units. Click a unit, Shift click to add, or drag a box to select. One inspector window shows the selection: one unit, or a UnitGroup with the count and averages. A sortable DataGrid lists the units and follows the selection.
Factory.unity FactoryController A plant of six machines that fill orders. The machines stamp, turn and shake while they work, and their parts ride belts to a dock. An ObjectiveTracker holds the order: one objective for each kind of machine, and a larger order when it ships. Live values in a DataGrid, gauges in each machine window, a temperature Graph, an output PieChart, a Gauge and a Sparkline of the parts a minute, a ResourceCounter for the parts made and their rate, and new parts that rise from their machine with a FloatingTextLayer. Dock zones on the left and right, and a notification when a machine gets hot. Arrange puts the screens at the edges.
Bindings.unity BindingsController Converters and two-way bindings, with no format or animation code. One SampleHero is the data source of the workspace. The Hero window shows it through tb: groups (upper, display-name, n0, percent, percent-text, hidden, duration, bytes, datetime, hex, visible). The Edit window edits it two-way (enum-int, not, hex, xz, has-value). AnimateBinding flashes the gold, shakes the card on a hit and pulses the health bar under 30%. A click on a shape of the scene or on Edit in the Shapes grid opens its editor: a Callout with a line to the shape that follows it, with a slider, a ColorPicker and toggles bound two-way to the public fields of SampleShape. Several editors stay open at once until their × button. The shape reads its fields each frame, so an edit changes the scene at once.
Kingdom.unity KingdomController A medieval RTS screen: the stock windows and toolbar in carved wood frames, parchment and stone buttons, with the Cinzel font (Kingdom.uss, see Restyle the chrome with images). The toolbar is the resource bar: a ResourceCounter each for gold, wood, stone and food, and each change shows as a delta under its counter. Company shows the selected knight (data-source-path="Selected"), The Keep builds, the chronicle slides in each line, and the map binds each marker to a knight with tb:percent, and a click near a marker selects its knight. Custom presets: the food glows red while starving, the marker of the selected knight beats, the gold jumps and bounces as a coin. KingdomSounds plays soft plucks and chimes, and a coin on each gold change (sound="coin"). The Sound window sets the volume and the mute of the game through AudioOptions. The windows show the button attributes: the chronicle has show-close-button="false", the map has show-max-button="false" and resizable="false", the Sound window has only a close button. The drag hints (snap preview, merge border, dock border) have the colors of the look, not the blue of the dark theme.
Firefight.unity FirefightController A first person shooter HUD: glass panels with neon lines and a cut corner, the Rajdhani and Share Tech Mono fonts, a crosshair over a night city (Firefight.uss). The toolbar holds the squad scores and the match clock (tb:duration). Weapon shows the weapon in hand (data-source-path="Weapon", slides up on a swap), Vitals shakes on each hit, Scoreboard is a DataGrid sorted by score, the kill feed slides in each line. Custom presets: the ammo blinks while low, the vitals glow red while the health is low. A Crosshair opens with each round and shows a red kill marker on each kill (ShowHit(CrosshairHit.Kill)). FirefightSounds plays square blips and noise clicks, and its hit sound plays from the HitShown event of the crosshair. The Radar window has enable-scrolling="false": a blip on the rim extends out of the radar, and a scroll view shows a scroll bar for it.
Inventory.unity InventoryController, ShapedInventoryController Two game inventories in one workspace, as three windows: Inventory, Item and Shaped items. Bag and equipment: two InventoryGrids on one model, a bag of 6 by 4 slots and four equipment slots. A drag moves an item, fills a stack of the same item, or swaps two items; Shift drags half a stack, and a right click splits one. An equipment slot takes only its kind, and shows the denied class during a drag of another kind. Each item has a ToolTip with the name as the header and a rich text body with the rarity color. The Item window shows the selected slot, with Use (drink, equip or unequip) and Sell, and an ItemCompare of a bag item against the worn item of its kind. The keyboard and the gamepad move between the slots; submit picks up an item and puts it down, cancel puts it back. The toolbar shows the gold, the value and the weight. The Style field of the toolbar changes the look of all the windows with one class. The rules are in SampleInventory, which SampleInventoryModel gives to the grids; the controller only shows them. Shaped items: two shaped InventoryGrids on one ListInventoryModel, a backpack of 8 by 8 cells and a chest of 5 by 6 cells, for items that take a rectangle of cells (ItemStack.Size) or the cells of an ItemShape: the Sun Cross is a plus and the Seven-League Boot an L, and the free cells in their box take other items. A drag shows a ghost of the item, and the grid colors the cells under it green when the item fits and red when it does not. R, the right mouse button or the Turn button turns the item; the left button stays down and the drag goes on. Arrange puts the items of the backpack again from the top left, the largest first. With a keyboard or a gamepad, submit picks an item up, the arrows move it and submit puts it down. The toolbar shows the cells in use. The same Style field changes the look (Classic, Sci-fi, Parchment). The How it is made column has a tab for each use case (drag and turn, keyboard and gamepad, look), each with its UXML and its C#. The last line of the C# follows the demo: the last drop, the selected item and the look class.
Dialogue.unity DialogueController A conversation with a merchant in a DialogueBox, under a tavern where Hesta stands behind the counter by the fire. Each line shows a pixel-art face of the speaker for the mood of the line, in a gold frame with the name on a plate; the mouth talks while the line types. The box shows the speaker name, the typed line, a prompt glyph and numbered choices. Submit (Enter, Space or the gamepad South button) or a click on the box shows the whole line while it types, then goes to the next line. When a line is complete, its choices take the focus; Up and Down move between them and wrap, a number key or submit picks one. The History button opens the lines so far. The last line offers "Talk again.". The conversation is SampleDialogue, an IDialogueSource: lines with an id, a speaker, rich text, the next line or the choices.
SaveLoad.unity SaveLoadController A save and load screen. The World window shows the place of the player and the play time; Travel goes to the next place. The Save / Load window is a SaveSlotList with four slots: a thumbnail that ElementImage.Capture took of the world, the place, the date and the play time. In Save mode a slot saves the game; over a saved game a MessageBox asks first, and Cancel has the focus. In Load mode a slot loads its game, and the empty slots do not respond. The ✕ button of a slot, and the Delete key, delete its game after a MessageBox asks. The keyboard and the gamepad move between the slots. The games are SaveSlot objects in memory.
QuestJournal.unity QuestJournalController A quest journal. A DataTree on the left shows the quest groups and their quests; the arrow keys or the gamepad move the selection. The right side shows the selected quest: the giver, the story, and the steps with ✓ for a done step and ▶ for the current step. A Timeline has a track for each step, colored done, current or pending, and the playhead at today. A selected group keeps the quest that shows. The quests come from SampleQuests.
GridDemo.unity GridDemoController GridPanel step by step, in four tabs. The panel of the selected tab shows in a Preview card, and the fields and the UXML of the use are in its tab. Playground: a field for each setting of a panel (columns, rows, auto-rows, gap, auto-flow, justify-items, align-items), six start points with a note, items that span columns and rows, the place of each item (GetPlacement), the size of each track (ColumnSizes, RowSizes) under the Preview, and a pale box for each cell. HUD: named areas (areas, GridCell.Area) around StatBar health and mana; one button changes the areas text and all the cells move. Form: columns auto 1fr for labels and fields, and the same children as two pairs in a row. Cards: repeat(auto-fill, minmax(120px, 1fr)) follows the width of the window, with auto-fit to compare. Each tab shows the UXML of its panel in a CodeBlock (GridDemoController.Describe).
TemplateDemo.unity TemplateDemoController An editor for one window template (WindowTemplateDefinition). Three tabs show the same template: Fields (a PropertyGrid), JSON (the text for RegisterTemplates) and C# (the code, in a CodeBlock). Five start points with a note: a ship card, a second UXML file as a part, a title that computes ({100 - Hull:0}), no formats, and the workspace cascade. Each change registers the template and makes the open ship windows again with RemoveWindowAsync, because a window keeps the template it was made with. A preview line shows the title and the window id that the formats give. Buttons open a window for each ship, change the data (the titles and the bindings follow), group the windows as tabs and remove them. A wrong field shows the error text and keeps the last good template. In UXML: an tb:WindowTemplateElement makes a crew window for each ship, and a closed Window with title-format shows only the last ship. Built in code: a WindowTemplate whose CreateContent builds a scan card with no UXML file. Each tab has a "How it is made" column with its UXML and C# in CodeBlock controls; the code follows the values of the fields.
CustomizeWindows.unity CustomizeWindowsController Eight live windows that show what a window can wear; see Customize windows. Icon image and Icon name: the Icon and IconName of a window. Buttons: three Switches turn the minimize, maximize and close buttons off and on. Badge and search: a chrome template with a Badge and a search field in the title bar. Video strip: a tall title bar with a VideoView. Slider: a slider and a DragHandle in the title bar; the slider does not drag the window. Chrome swap: the same window in the Default, the Glass and an own Banner chrome, with the title and the content kept. Runtime Badge: code inserts a Badge into TitleBarElement and removes it. Every text, the tour included, comes from the files of Strings in nine languages.
WindowOverviewDemo.unity WindowOverviewDemoController The window overview of a Workspace with six live windows: a slime pen and a guard post with AnimatedImage walkers, a market Graph and Sparkline, an AnalogClock tower that starts minimized, a tavern ChatView in a tab group with the market, and a Minimap with patrols. Hold RB, or Ctrl after Ctrl+Tab, and the windows shrink into a grid while they keep running; the toolbar counts the frames that run while the overview shows. An InputViewer lights the window keys, and a settings Card turns the overview, its time, the motion and the D-pad rule on and off at once. The Show me tour waits for each key. See Window overview.
NotificationDemo.unity NotificationDemoController The toasts of Workspace.Notifications (NotificationArea, NotificationBubble) and Alert, one tab for each use in a NotificationArea window. The Preview card shows the buttons of the tab and a status label that counts the events (shown, clicked, dismissed, timed out). Kinds: Show(message, severity, durationMs) with the four Severity values, Title and Detail. Time: DurationMs (0 stays), ShowProgress, Closable, the pause under the pointer and RemainingMs. Actions: Clicked with focusable opens the Quest log window through OpenWindow, AddAction adds Accept and Decline buttons, and ShowTask shows a spinner and then the result. Burst: MaxVisible, Queue, QueuedCount and DismissAll, with a note on the sound. Corner: the seven NotificationCorner places, from a dropdown or a button on a small screen. Presets: NotificationPreset.Achievement (a gold card that rises into place) and NotificationPreset.KillFeed (a thin line from the right). Banners: a second area with corner="Center" and max-visible="1" shows "Wave 3", "Quest complete" and "Boss defeated" through ShowBanner, one after the other. Alerts: Alert banners that stay in the layout: Severity, Title and Description follow a power slider, a child button is the action, and Closable, Open, Close and Closed handle the notice. Each tab shows the C# of its last toast, and Burst, Corner, Banners and Alerts their UXML. The Quest log is a second window.
RadarDemo.unity RadarDemoController Radar step by step, in seven tabs. The radar of the selected tab shows in a Preview card, with its status under it; the fields and the code of the use are in its tab. All radars show one world: seven contacts that go around the player (RadarContact.Position); Step moves them, and the fields of the world above the Preview stop them and turn the player. Minimap: a class for each kind of contact (friend, enemy, neutral), range, clamp-to-edge for a contact out of range, and the contact below the pointer or the selected contact in a status (WorldToRadar). Heading: north up next to heading up (Heading, rotate-with-heading). View cone: view-angle and view-range with four start points (guard, forward scanner, lantern, no limit), the contacts in view (IsInView), and a class that hides the others. Sonar: pulse, pulse-duration, Ping and sweep; pulse-reveal keeps a blip dark until the ring reaches it, a toggle turns it off, and ContactPinged writes the status. Scope: sweep-reveal shows a contact only as the sweep passes it, then the contact fades over sweep-fade-duration (0: one turn); a toggle turns the reveal off and sliders change the sweep and the fade. HUD corner: the same world on a small radar with heading up, in the corner of the screen. Looks: the same radar with the theme, a green phosphor class and a clean sci-fi class. Each tab shows the code of its radar in a CodeBlock (RadarDemoController.Describe).
PieChartDemo.unity PieChartDemoController PieChart step by step, in six tabs. The chart of the selected tab shows in a Preview card, with its status under it; the fields and the code of the use are in its tab. Drill-down opens the parts of a slice of a colony budget, three levels deep (category, building, item): SliceClicked gives the slice, SetData shows its parts, and a Breadcrumb goes back up (Push, Navigated, NavigateTo). Donut and labels has a field for each text setting: inner-radius, center-text (the total, or the selected slice), start-angle, format-string, show-labels, show-percentages, show-legend and gradient. Live data changes a fleet with sliders and buttons: SetData with the same labels keeps the slices and the selection, and Animate moves them to their new shares. Events reports SliceHovered, SliceSelected and SliceClicked in labels, sets SelectedSlice from buttons and turns interactive off. HUD size shows three small pies in buttons (show-legend, show-labels and interactive off, explode-offset 0) above a large chart. Custom look restyles the chart from USS with two looks (--tb-pie-stroke, the legend and label classes) and sets PieSlice.Color. Each tab shows the C# or the UXML of its chart in a CodeBlock.
HeatMapDemo.unity HeatMapDemoController HeatMap in four uses of a game, one per tab, with a status label that tells the selected cell (CellSelected, SelectedRow, SelectedColumn) and the cell under the pointer (CellHovered), and the UXML and C# of each use. Deaths: a 12 x 12 grid of a map from UXML alone (row-labels, column-labels and values over several lines); Next match adds the deaths of a match with SetValue while the selection stays, and the fields set ShowValues, ShowLegend, FormatString, Interactive and Animate. Players online: seven days by 24 hours from SetData, with Next week, Steps and a Cold to hot scale through LowColor, MidColor and HighColor. Damage table: weapons against armor with a fixed Min and Max, so 1.0x is always the mid color; Balance patch moves each value toward 1. Looks: the theme and three classes (an overlay over a minimap, thermal and parchment) through the --tb-heat-map-* variables, with the USS.
TreemapDemo.unity TreemapDemoController Treemap in four uses of a game, one per tab, with a status label that tells the selected box (ItemSelected) and the box under the pointer (ItemHovered), and the UXML and C# of each use. Guild bank: the items of a guild bank by category from UXML alone (tb:TreemapItem children); Deposit loot adds to the counts, a double click or Enter zooms into a category, and the fields set ShowValues, FormatString, Interactive, Zoomable and Animate. Build size: the disk use of a game build from AddItem, with a Breadcrumb that follows ZoomChanged and zooms out through ZoomTo, and Next patch for new sizes while the selection and the zoom stay. Damage by skill: the skills of a hero grouped by element, in the color of the element (TreemapItem.Color), with the top skill from Percentage; Fight a round adds damage, and the Hero field builds the treemap again. Looks: the theme and three classes (tiles, outlined and dense) through the --tb-treemap-* variables, with the USS.
SankeyChartDemo.unity SankeyChartDemoController SankeyChart in four uses of a game, one per tab, with a status label that tells the selected node or link (NodeSelected, LinkSelected) and the one under the pointer (NodeHovered, LinkHovered), and the UXML and C# of each use. Gold economy: the gold of a day from quests, loot and sales to what the players spend and save, from UXML alone (links over several lines); Next day sets new links with SetLink that keep the gold even, and the fields set ShowValues, FormatString, Interactive and Animate. Factory: ore through the smelter to plates, wire, gears, circuits and storage, Next hour, and NodeColors for the goods. Player funnel: 1000 players of a dungeon by difficulty, to Quit, Victory and Defeat, with SetNodeColor on the ends and a selection from code. Looks: the theme and three classes (ribbons, blocks and ledger) through the --tb-sankey-chart-* variables, with the USS.
CalloutDemo.unity CalloutDemoController Callout and its relatives, one tab for each use in a Callout window. The Preview card shows the HUD or the targets of the tab and a status line that reports Opened, Closed and the steps; only the callouts of the selected tab are open. Tutorial: one callout goes over five parts of a HUD; each step sets Title, Text, Placement, Alignment and calls Open(target), with connector, highlight-target, tip-size and draggable (GoTo, Next, Back on the controller), and the tutorial goes on at its step when the tab shows again. Spotlight tour shows the five steps again as a TourOverlay: the screen dims around each part, and the Bag step waits for its click (StartTour). Sides: placement, alignment, tip-size, severity, look and Toggle. Line: the USS variables --tb-callout-connector-color, -width and -cap, highlight-target, and a drag that leaves Side at Free. Field: FieldError.Show, Clear, Has on a form that checks itself. Items: one HoverCard for four items, filled in Opened from Target (AttachTo, open-delay), next to a plain tooltip. Tooltips: ToolTip with header, placement and tooltip-class, in four colors and three looks. Looks: a speech bubble (look="Talk") and a scanner tag with lock-on brackets (target-mark) from USS classes. 3D target: a camera draws a scene that the controller makes at runtime into a render texture on the stage; a lock-on with TargetRenderer, target-mark and clamp-to-edge follows a sphere that flies behind the camera, the NPC has a Talk bubble (TargetWorld), the cube a Thought bubble and the pillar a label (TargetWorldPosition). The controller destroys the scene in OnDestroy. Each tab shows its UXML, USS and C# in CodeBlock controls; those of Tutorial, Sides, Line, Field and 3D target follow the live callouts.
TourDemo.unity TourDemoController TourOverlay in one window with a mock editor app and a mock game HUD. First run: a tour of six steps declared in UXML, with block-outside, pass-through-hole, show-progress and prefs-key; the Help button forgets the key and shows the tour again. Tutorial step: a tour made in code over the HUD; its Bag step has wait-for="Click", so Next shows only after the click. Interactive: a tour declared in UXML whose steps wait until the user types fire and presses Enter (wait-for="Submit" with value), picks Prefabs (wait-for="Code", and the controller calls Complete), moves the padding slider on the Shapes tab (wait-for="Change"; the tab opens for the step) and clicks the bag (auto-advance). Shapes: shape, padding and placement on a running tour. A status line reports StepShown, Finished and Skipped, and CodeBlocks show the UXML and the C# of each tour. The demoTour in the UXML is the tour of the Show me button in the demo header.
GaugeDemo.unity GaugeDemoController The meters of the toolbox in one window with four tabs. Car dashboard: four Gauge controls (MinValue, MaxValue, Value, DisplayMode Arc or Needle, Divisions, MinorTicks, FormatString, Animate off) show a car that a throttle slider drives through Step(seconds); at a gear change the engine speed falls at RPM_RATE, so the needle of the tachometer moves down and does not jump; Ranges gives each gauge colored zones in the theme colors, and the arc or needle takes the color of the zone that holds the value. Power meter: the zones of a gauge are a golf swing; a perfect hit makes the green zone smaller. Playground: sliders and toggles for each setting of a gauge and a ring (value, min, max, thickness, divisions, minor ticks, size, format, needle, animate, labels, value text, zones, Indeterminate), four start points, and the UXML in a CodeBlock. Sizes and looks: rings from 16 to 72 px and gauges from 80 to 160 px, and two looks (Neon, Brass) from one USS class that sets color, --tb-gauge-track, --tb-gauge-tick, --tb-progress-ring-track and the parts of the ProgressBar. The meters of the selected tab show in a Preview card, with their status under them; each tab holds its fields and its UXML and C# in CodeBlock controls, and the code follows the values of the fields. The ProgressRingDemo, SkeletonDemo and IndeterminateProgressDemo show the ring, the placeholder and the running bar by use.
RadialMenuDemo.unity RadialMenuDemoController RadialMenu step by step, one tab for each use. The Preview card shows the wheel of the tab and a status label. Weapon wheel: icons drawn in code, a disabled wedge for a weapon with no ammo, and the chosen weapon in a HUD label. Build menu: a category folds out a second ring of buildings (SubItems, OpenItem), gold enables each building, and a slider sets sub-ring-size. Wedges: the number of wedges, inner-radius, the size, the toolbox style, animate and cancel-text, changed live. Looks: a sci-fi thin ring and a parchment disc, each from the six USS variables. Command wheel: a wheel that opens at the pointer on a right click or while Q or the left shoulder is held, takes the right stick (Point), and cancels from the center, Escape, a click outside or a release with no wedge. Each wheel reports HighlightChanged, ItemChosen and Cancelled in the status label, and each tab shows its code in a CodeBlock (RadialMenuDemoController.Describe).
DataGridDemo.unity DataGridDemoController DataGrid step by step, in eight tabs with game data. Roster: column formats, SortByColumn, ClearSort, AllowSorting and GroupBy with collapse and expand. Market: SearchText, SetFilter per column, a SetCellRenderer cell with a class for gain and loss, and a footer with SetFooter. Leaderboard: PageSize, ShowPagination, Page and the parts of the Pagination (first and last buttons, texts, page size selector, sibling count). Units: the cell editors (text, number, enum and Choices dropdown, toggle), a label for a member without a setter, a button column with CellClicked and SetValue, and ReadOnly. Selection: SelectionMode, SelectionColumn and SetSelection; SelectionChanged fills a detail panel and ToCsv(true). Compare: select two or more ships, then Compare. ShowData opens a new window whose data is the list of ships, so title-format="Compare {Count} ships" formats the list. The window has a grid and two PieCharts of the ships in the list. Columns: AllowColumnResize, AllowColumnReorder, AllowColumnHide, ShowColumnMenu and SetVisibleColumns. Signal log: 500 to 50000 rows with few row elements, RowHeight, and a terminal look in USS (data-grid-demo-terminal). The grid of the selected tab shows in a Preview card, with its status line under it. Each tab holds its fields and a CodeBlock with the C# of its grid (DataGridDemoController.Describe); Compare also shows its UXML, Signal log its USS, and Selection the CSV.
ChartsDemo.unity ChartsDemoController Graph and SpiderChart in game uses, in one window with five tabs. The chart of the selected tab shows in a Preview card, with its status under it; each tab holds its fields and the UXML of its chart from the live values in a CodeBlock. Live: a gold income graph that scrolls: GraphSeries.MaxItems and AddPoint drop the oldest sample, DataPointAdded reports each one, with a pause, a single step, ClearPoints and a slider for the samples kept. Series and kinds: three series with Categories, drawn as each GraphType (ChartType), with Stacked, ShowValues, ShowLegend, GraphSeries.Hidden from toggles or the legend, and SelectPoint, DataPointSelected and DataPointHovered in the status. Axes: SetAxisRange, ShowGrid, GraphSeries.SecondaryAxis with Y2Title, YFormat, SetAxisTitle, and SetView, ResetView, IsZoomed and ViewChanged. Compare: two weapons on six SpiderAxis, Value against Compare with ShowCompare, a slider for each axis, and ValueText; Animate with a slider for AnimationDuration, and a button that swaps the two weapons so that the shape moves. Looks: both charts in the theme look and two custom looks, through the --tb-graph-* and --tb-spider-chart-* variables and GraphSeries.Color. The SparklineDemo, CandleSeriesDemo and SpiderChartDemo show the sparklines, the candles and the skill wheel, and the HeatMapDemo, TreemapDemo and SankeyChartDemo show the heat map, the treemap and the Sankey chart.
SparklineDemo.unity SparklineDemoController Sparkline step by step, in one window with a Preview card and four tabs. Defaults: the gold that Mira Vale earned in a week, a Sparkline with only its values, with fields for ChartType, MaxItems (a lower count drops the oldest values) and ShowLast, and Add a day (AddValue) and Clear (ClearValues). Market: the goods of Port Varen, each row with a 130 x 26 Sparkline of fourteen days, and a dropdown for its kind: the prices as a Line, or the change from the day before as Bar or WinLoss. The selected row shows the same prices in a large Graph (SetData), and Next day moves each row one day on. Live: a raid HUD with the frame time, the ping and the damage per second, which adds a value every 50 ms through Step(seconds), with a pause, a slider for MaxItems and a toggle for a fixed Min and Max. Looks: the season of a player (rating, gold profit, matches won and lost) in the theme and in the Gold and Neon looks, from --tb-sparkline-color and --tb-sparkline-negative, with LineWidth, ShowLast and the color and negative-color attributes, which win over the look. Each tab shows the UXML and C# of its sparklines from the live values.
CandleSeriesDemo.unity CandleSeriesDemoController CandleSeries step by step, in one window with a Preview card and four tabs. Defaults: eight days of Iron ore in a CandleSeries with only its candles text, with fields for the Label and the candles, and Add a day (AddCandle) and Clear. Market: a good from a dropdown (SetCandles) with the average of five days as a line (SetData), Next day (AddCandle and AddPoint, while MaxItems drops the oldest), a slider for the days shown, a toggle that hides the average, and DataPointSelected and DataPointHovered with GetCandle in the status. Volume: the units sold of Spice as a second GraphSeries on the right axis (SecondaryAxis, Y2Title), drawn as bars or a line, with a toggle that hides them and a toggle that sets Y2Max so that the bars stay at the bottom. Looks: Silk in the theme and in the Colorblind and Parchment looks, from --tb-graph-candle-up and --tb-graph-candle-down, with the color and down-color attributes, which win over the look, and toggles for the grid and the legend. Each tab shows the UXML and C# of its graph from the live values.
SpiderChartDemo.unity SpiderChartDemoController SpiderChart step by step, in one window with a Preview card and four tabs. Defaults: the stats of a hero on five SpiderAxis with only the axes in the UXML, a dropdown of five heroes and a slider for each stat; the status gives the points and the best stat. Skill wheel: AddAxis and RemoveFromHierarchy change the number of axes from three to eight, Train the weakest skill raises the lowest value up to MaxValue, and there are sliders for Rings, MaxValue and LabelSpace and a dropdown for FormatString. Level up: a talent from a dropdown sets the Compare values to preview its gain with ShowCompare; Learn moves the values to them with Animate, AnimationDuration and AnimationEasing, and Reset goes back. Looks: a hero in the theme and in the Arcane and Parchment looks, from the --tb-spider-chart-* variables, with a toggle for the compare outline. Each tab shows the UXML and C# of its chart from the live values.
ChatDemo.unity ChatDemoController ChatView in five tabs, with the chat of the selected tab in a Preview card, and a second window that shows the C# of the last message in a CodeBlock (ChatDemoController.Describe). Party chat: Add puts the message of the user on the right, and a member answers after a short time; the answer is in the list at once as "..." and Update gives it its text and time. An AvatarGroup (max, Refresh) shows the members, and a toggle sets show-avatars. Channels: one view for three lists (Clear, Add), with a Badge (Count, Corner) on each channel button for the messages not read. Combat log: the class chat-demo-log removes the bubbles and puts the time in front of the rich text, with ChatSide.System as the headline of a wave. Quest giver: each answer is a button, and the class chat-demo-talk makes speech bubbles and square portraits. History and limit: MaxItems, IsAtEnd, NewCount, ScrollToEnd, and OlderMessagesRequested with Prepend. The buttons and the status of each use are under the preview; each tab has its fields and a "How it is made" part with its UXML and C# in CodeBlock controls, and the code follows the values of the fields.
DataTreeDemo.unity DataTreeDemoController DataTree by use, in five tabs. The tree of the selected tab shows in a Preview card, and its buttons, fields and code are in its tab. Ship is a hierarchy with a detail panel: SetRoots, SelectionChanged, SelectedItem and ParentOf fill the panel, and the buttons call Select, SetExpanded, IsExpanded, View.ExpandAll and View.CollapseAll. Codex is a search: SearchText shows the matches with their parents and marks them, the mark color is the USS variable --tb-data-tree-match, and Select gives false for an item that the search hides. Saves is a list that changes: Refresh after the data changes, a text function for the row text, ItemsChosen to load a save, and View.selectionType with SelectedItems for several saves. Looks gives one tree three looks from USS, with View.fixedItemHeight and View.showAlternatingRowBackgrounds. Skill tree has rows of its own from View.makeItem and View.bindItem, with a class for the state of a skill. Each tab shows its code with the values of the moment in a CodeBlock, and a status line under the Preview reports the selection and expand events.
AnimatedImageDemo.unity AnimatedImageDemoController AnimatedImage in a small game scene, the Dungeon gate, with every image from a SpriteSheet asset in Resources/UIToolboxSamples/Sprites, which other demos use too. Two torches flicker on a stone wall, coins spin on the floor, a gem sparkles on a pedestal, and a heart beats and a coin spins in the HUD. The knight idles; Walk (W) loops the walk clip and moves the knight across the floor, with FlipX at the edges; Attack (A) and Hurt (H) play a clip with PlayOnce and go back to the clip of before; Open chest (C) plays the chest once, and its Finished event bursts coins from a ParticleLayer to a ResourceCounter; Explode (E) shows an explosion that plays once and hides. Settings is a Card that changes the knight: the clip, a frames per second slider, a Speed Knob, the Mode in an OptionSelector, Flip, a Tint ColorPicker, Pause or Play and a frame slider that follows FrameChanged; the UXML under it follows the settings. Code shows the UXML of the images and a SpriteSheet made in C#, and USS the sizes.
TextEffectsDemo.unity TextEffectsDemoController AnimatedLabel by use, in six tabs, with the labels of the selected tab in a Preview card and the code of each live label in a CodeBlock. Title: "Text Animation" on a light panel with <gradient> on one word; buttons change the text or the Effect (Pop and Grow from their tags, Hand-drawn from effect="Jitter"), and a second label has effect="Pulse". Playground: a text field with the tagged text, a button for each tag, sliders for Speed and Amplitude, a Playing toggle, and DisplayText and IsAnimating in the status. Loot and damage: <gradient=#from,#to>, <shimmer>, a gradient with <wave>, <shake> and <pulse>. Hints: <highlight> behind key names, with an optional <pulse>. Colors: the three sources of a color, which are the tag, the properties GradientFrom, GradientTo and HighlightColor, and the USS variables. Which label?: a table that tells when to use each of the two labels, with a TypewriterLabel that types a <wave> word when the tab opens and a Type again button that calls Restart. The TypewriterLabelDemo shows the typing label by use.
TypewriterLabelDemo.unity TypewriterLabelDemoController Five TypewriterLabel uses, one per tab. The Preview card shows the use of the tab with its buttons and a status label that shows VisibleGlyphs while a line types; the labels of a tab type again when the tab opens. Dialogue: the dialogue box of a game over a night city, with the name in an AnimatedLabel; a click on the box or Continue calls Complete while the line types (IsTyping), and the next click shows the next line. The tab sets CharactersPerSecond (0 shows the line at once) and Next line by itself, which starts the next line 1.2 s after Finished; Type again calls Restart. Terminal: the lines of a sci-fi terminal in a mono font; each line types on the Finished of the line before it, after a pause, and the tab sets the speed and the pause, with Run and Skip. Quest letter: a letter on parchment in the Cinzel font that gets its signature and its seal on Finished; the tab picks one of three letters and the speed, with Read again and Skip (Complete). Looks: one text and one speed for four labels (Default, Glow while it types from the tb-typewriter-label--typing class, Terminal and Comic); the status counts the finished labels. Lyrics: a lyric video on a color field, driven by a Timeline with three tracks. The Words track has a marker for each word, and the marker times are the Cues of the line (RevealBy Word, Entry Pop); the Effects track has spans that set Effect (pop, shake, wave, rainbow, jitter, grow), and the Camera track has zoom and spin spans that scale and turn the scene. The playhead sets Elapsed of each label, so a scrub shows the scene at any time, forward or back. The scene also has a Subtitles caption after a music note, a chat bubble whose words pop in at their cues, a comment that slides in glyph by glyph, the stretched word "onliiii" in an AnimatedLabel, and a ResourceCounter score that falls faster and faster. A drag of a marker or a span moves its cue or its effect (ItemChanged); the tab has Play (Pause while it plays), Restart and Reset, an Entry picker, Entry seconds and Loop. Each tab shows the UXML and C# of its use, and Looks its UXML and USS.
ProgressRingDemo.unity ProgressRingDemoController Four ProgressRing uses, one per tab. The Preview card shows the use of the tab with its buttons and a status label. Basics: one ring with a field for Value, Thickness, the size, ShowText, Animate and Indeterminate, and Empty, Half and Full buttons. Character: the health, shield and stamina of a ranger with a Label child for the number (stamina has ShowText), the ProgressBar of Unity with the same health, and a USS class that gives the health ring the danger color at Danger at or less; Take a hit (the shield first), Heal, Recharge shield and Sprint, and a cooldown ring around the Fire button that keeps it disabled for 3 seconds. Loading: a connection to a world server: Indeterminate spins the ring while the time is unknown, then the ring shows the download; the tab sets Show text and Thickness, with Connect. Looks: rings from 24 to 96 px, and five colors with icons (health, mana, experience, gold, no track) from color and --tb-progress-ring-track; one value and one Indeterminate for all. Each tab shows the UXML and C# of its use, and Looks its UXML and USS.
SkeletonDemo.unity SkeletonDemoController Four Skeleton uses, one per tab. The Preview card shows the use of the tab with its buttons and a status label; a tab loads again when it opens. Shapes: one skeleton with a field for Shape (Block, Text, Circle), Lines, Animated, the width and the height, and a button for each shape. Profile card: the card of a guild member with a UserAvatar; skeletons hold its place for Load seconds, then the next member shows; Pulse sets Animated, and Reload loads again. Inventory: ten wood slots, each with a skeleton the size of its item; each item shows when it comes, or all show at once, with Open the bag. Looks: four cards (Default, Light, Round, Parchment) whose class styles the tb-skeleton parts; Animated and Lines for all. Each tab shows the UXML and C# of its use, and Looks its UXML and USS.
IndeterminateProgressDemo.unity IndeterminateProgressDemoController Four uses of IndeterminateProgress on the ProgressBar of Unity, one per tab. The Preview card shows the use of the tab with its buttons and a status label. Basics: IndeterminateProgress.Set(bar, on), the value and the title of one bar, with Run and Stop. Connection: the bar runs while a server connection has no known time, then Set(bar, false) and the download fill it; with Run while it connects off, the bar stays at 0% and looks stuck, and State in the title writes the state into title; Connect. Matchmaking: the bar runs while the queue searches and six player slots (UserAvatar) wait, then it fills over the countdown; the tab sets the search and countdown seconds, with Find a match and Cancel. Looks: five bars (Default, Thin with no title, Long runner, Round, Wood skin) from classes that style the runner (RUNNER_CLASS) and the parts of the ProgressBar; one Indeterminate and one value for all. Each tab shows the UXML and C# of its use, and Looks its UXML and USS.
SubtitlesDemo.unity SubtitlesDemoController Four Subtitles uses over game screens, one per tab. The Preview card shows the use of the tab with its buttons and a status label. Lines: Show(text, speaker, seconds) from the fields, where 0 seconds uses the reading time of CharactersPerSecond and MinDuration; Next line shows a conversation, Clear fades the lines out, MaxVisible keeps the newest, and the status follows LineCount. Cutscene: SubtitleTrack.ParseSrt reads an SRT track, and Play(track, () => time) follows the clock of a panning shot with its speed and a loop; a click on the timeline (a mark for each cue), Back 5 s or Forward 5 s seeks (IndexAt; Advance(0) shows the line of the new time at once), CueShown feeds the status, and Stop ends the track off its tab. Radio chatter: the calls of a squad over a map, on the left with MaxVisible; SetSpeakerColor gives each speaker the color of a palette (Squad colors, Command stands out, Color-blind safe with the Okabe-Ito colors), the marker of the speaker grows while they talk, and Contact! shows a rich text call for 4 seconds. Looks: four screens (Default, Cinema, Terminal, Storybook) from --tb-subtitles-background, --tb-subtitles-speaker-color and the line parts; the tab sets TextScale and ShowSpeaker on each. Lines and Radio chatter show their UXML and C#, Cutscene its SRT and C#, and Looks its UXML and USS. On a gamepad, left and right on the focused timeline seek by 5 seconds.
AnimationsDemo.unity AnimationsDemoController Five ways to animate and the easing curves, in a window with a Preview card and six tabs. The Preview card shows the sample of the selected tab; the tab has its buttons and its code in a CodeBlock. Presets: a button for each built-in preset, PlayPresetAsync with a Loop toggle, and StopPreset. Custom presets: jelly, wiggle and heartbeat, written in AnimationsDemo.uss with --tb-anim-steps, step classes, a timing for each step and a scoped step that beats the card color. Bindings: AnimateBinding flashes the gold, shakes the card on a hit and pulses the health bar while it is low (trigger="WhileTrue"), with no animation code. Transitions: a toast with its own state class and transition classes, shown with WindowAnimations.EnterAsync and hidden with PlayAsync. Windows: Drop, Pop and Slide restyle .tb-window--closed, .tb-window--anim-open and .tb-window--anim-close under a class on the root; a sample window opens and closes. Easing: a card for each of the 31 Easing curves draws the curve with Painter2D, has a USS chip when USS has the curve, and plays when you point at it or click it: a dot runs along the curve while a box slides with it. The Easing tab has Play all and a Time slider (250 to 2000 ms); under the cards, an In a game strip: coins drop with OutBounce, a damage number pops with OutBack, a menu slides in with OutQuint. See Animations. Focusing an easing card plays it, and A plays it again.
ColorDemo.unity ColorDemoController ColorPicker by use, in eight tabs. The Preview card shows the view of the selected tab, with its status under the stage and the hint of the tab in its description; each tab holds its fields and its UXML and C# in CodeBlock controls. Ship paint: three pickers with compact tint the hull, trim and glow layers of a painted ship; scheme buttons set Hex, and a C# block shows value, Hex and the alpha from the live values. Team color: the same control with a look from USS only (the tb-color-picker__picker part hidden, big round tb-color-picker__swatch swatches); Presets are the teams, the banner follows the change event and Committed reports the pick. Crosshair tint: a picker that is always open next to a game scene sets Crosshair.Color of the Crosshair in it, with toggles for ShowAlpha, Compact and Eyedropper, a text field that sets Hex with any HTML color, a status line with Hex, Hsv and the alpha, and the UXML of the picker. Change and Committed: a Live box follows the change event on each move of a drag and a Saved box follows Committed, with the count of each, RecentCount and RecentColors. Wheel and harmony: shape="Wheel" with a Harmony dropdown; HarmonyColors paint a unit and a palette, and a click on a harmony swatch makes its color the value. Parts: parts with only the area and the bars, a compact picker with only the hex input, and a toggle for each ColorPickerParts flag. Sizes: pickers 180, 260 and 360 px wide; under 358 px the inputs go under the area. The view scrolls, because the three are wider than the stage together. Theme and accent: ThemeSelector sets the theme of the workspace (Workspace.SetTheme, AvailableThemes), and a compact picker gives one panel its own accent through the style of its elements; off, the style is cleared and the theme color comes back.
CurveDemo.unity CurveDemoController CurveField by use, in one window with two tabs beside a stage; each tab shows its code in a CodeBlock. Jump arc: a CurveField with Range 0 to 1 sets the arc of a ball that jumps on the stage; Editing shows a drag at once, and a slider sets the jump time. In a PropertyGrid: a weapon with an AnimationCurve damage falloff and a Gradient trail color, which the grid edits with a CurveField and a GradientField, with undo.
OnScreenKeyboardDemo.unity OnScreenKeyboardDemoController OnScreenKeyboard by use, in one window, with the enter key that suits each field (EnterKeyHint, set by the class tb-osk-enter--{hint}). Name your game: a TextField of the Name kind that a Keyboard button opens the keyboard for, with the Next key, which saves the name (Submitted) and moves the focus and the keyboard to the Tagline field, which has the Done key. Chat: a text field with the Send key, and a send button, that add the line to a ChatView; the Send key sends Return, which sends the line. Search: a field with the Search key that counts the lines of the chat that match. PIN pad: a masked field of the Number kind with a pad of digits set by SetLayout and the Done key; four digits open the safe or clear the field. Kinds and enter keys: a dropdown sets the TextFieldKind of a field, a second dropdown gives it any enter key (SetEnterKey), a toggle makes it multiline so that the Enter key adds a new line, and another toggle replaces the letters with a layout of your own; a C# block shows the code. A card lists the gamepad buttons of the keyboard.
ButtonsDemo.unity ButtonsDemoController The buttons of the toolbox in three tabs. The Preview card shows the view of the selected tab: the variant table with Find match and its status, the main menu and the dialog, or the rune panel. Variants is a table of each ButtonStyle variant (default, PRIMARY_CLASS, DANGER_CLASS, OUTLINE_CLASS, GHOST_CLASS, LINK_CLASS) by size (SMALL_CLASS, normal, LARGE_CLASS), with an ICON_CLASS button and a disabled button; a press shows the UXML of that button in a CodeBlock in the tab, and Find match uses ButtonStyle.SetLoading and IsLoading. Menu and dialog builds a main menu and a dialog button row from the variants, and AttentionFlash.Set makes the next step flash; Show the steps again in the tab starts it again. Custom look puts a rune look on the Attack, Defend and Flee buttons with one class on the panel, shows the USS in a CodeBlock, and a ToggleButton in the tab takes the look off. The ToggleButtonDemo, SplitButtonDemo and AutoClickButtonDemo scenes show the other buttons.
ToggleButtonDemo.unity ToggleButtonDemoController Four ToggleButton uses, one per tab, with Press all and Release all buttons and a status label fed by the ChangeEvent<bool> of each button (RegisterValueChangedCallback<bool>). Mute button: the mute button of a music player disables its volume slider; the tab sets text, value, the enabled state and the size (ButtonStyle.SMALL_CLASS, LARGE_CLASS). Chat box: Bold and Italic buttons set the font style of a message; the tab sets their values, the message and the ButtonStyle.SET_CLASS that joins them in a set. Filter chips: Weapons, Armor and Potions chips show and hide the six items of an inventory, with a round look for the chips, and the ToggleButtonGroup of Unity (ToggleButtonGroupState) picks the single weapon slot. Look: a rune and an underline look restyle the pressed state (.tb-toggle-button--pressed) of three battle settings with one class on the panel. Each tab shows the UXML of its use and its C#, or its USS for Look.
SplitButtonDemo.unity SplitButtonDemoController Four SplitButton uses, one per tab, with an Open the list button (Open) and a status label fed by Clicked and ItemPicked. Save: a Save button with its list in the UXML choices attribute; the tab sets Text, Choices and the enabled state, and a label tells the last save. Craft: "Craft arrow" with an Items list of ChoiceItem with detail texts that disables what the iron ore does not pay; a slider and a Mine button set the ore, and a toggle puts ButtonStyle.PRIMARY_CLASS on both parts. Orders: the orders of a squad as ChoiceItem with a Group and a Detail; the tab turns the groups and the details on and off, and a toggle makes ItemPicked set Text, so the main part repeats the last pick. Look: a rune and a pill look on a tb-style-scope element (AnchoredPopup.STYLE_SCOPE_CLASS), so the open list takes the look too. Each tab shows the UXML of its use and its C#, or its USS for Look.
AutoClickButtonDemo.unity AutoClickButtonDemoController Four AutoClickButton uses, one per tab, with Restart and Cancel buttons (Restart, Cancel) and a status label that tells who clicked (ClickedByTime); the texts show SecondsLeft, and the time of a hidden tab waits (Paused). Result screen: a Continue with no settings clicks itself after 3 seconds and starts the next wave; the tab sets the text, Delay, a pause while the pointer is over it and the seconds in the text. Party invite: Accept and Decline with auto-start="false"; the time picks one answer (Restart on it, Cancel on the other), and the tab sets Delay and the answer. Delete a save: the first press starts the time, a second press keeps the save, and only the click of the time deletes it; the tab sets Delay and ButtonStyle.DANGER_CLASS. Look: Attack, Defend and Flee restart an End turn button of 6 seconds, and a rune and a fill look restyle its bar (.tb-auto-click-button__progress) with one class on the panel. Each tab shows the UXML of its use and its C#, or its USS for Look. Focus pauses Continue like the pointer does.
SwitchDemo.unity SwitchDemoController Four Switch uses, one per tab, with All on and All off buttons and a status label fed by the ChangeEvent<bool> of each switch. Settings: the switches of a settings screen, where Subtitles shows a caption and Show damage numbers shows a damage number; the tab sets the label, value, the enabled state, Small and Description of Subtitles. Accessibility: Reduce motion, High contrast and Hold to sprint with a Description under each label; Reduce motion stops the knobs of the demo and High contrast outlines an enemy, and the tab shows or hides the descriptions and edits one. Map layers: small switches (Small) show and hide the quest, shop, portal and chest pins of a map; the tab sets the size and the side of the text (label on the left, text on the right). Look: a square and a large look restyle the track (.unity-toggle__checkmark) and the knob (.tb-switch__knob) with one class on the panel. Each tab shows the UXML of its use and its C#, or its USS for Look.
RatingDemo.unity RatingDemoController Four Rating uses, one per tab, with Clear and Fill buttons that skip a read-only rating, and a status label fed by the ChangeEvent<float> of each rating. Review: the review of a quest with a verdict line; the tab sets value, Max, AllowHalf and ReadOnly. Average: a market whose shops show their average in read-only stars that snap to half steps (SetValueWithoutNotify), and your vote moves the average of the picked shop; the tab picks the shop and sets its average. Symbols: read-only hearts for health (the symbol attribute), dots for archery whose Symbol and Max the tab sets, and an item star picture for the level (Image) that a toggle swaps for the glyph. Look: a gold and an ink look restyle the stars (.tb-rating__star, .tb-rating__fill > .unity-label) with one class on the panel. Each tab shows the UXML of its use and its C#, or its USS for Symbols and Look.
FormDemo.unity FormDemoController The form controls in six tabs. The Preview card shows the form of the selected tab, with its change events in a status label under the stage; each tab holds its buttons and options and shows its UXML, C# or USS in a CodeBlock made from the live values. Character is a form that checks its inputs: FormField (Label, Description, Error, Horizontal) wraps a TextField, a select-only ComboBox, three NumericUpDown (MinValue, MaxValue) and a Rating; Create sets FormField.Error on each wrong input and opens a callout on the Rating with FieldError.Show. Server has three MaskedTextBox (Mask, PromptChar, UnmaskedText, IsComplete) for an address, a date and a key, three InputGroup with text, button and clear-button addons (ShowClearButton, ClearText), and a field with ClearButton.Attach; Join marks each incomplete box with FieldError.Show. Search puts AutoCompleteField (Items, ItemPicked), SearchDropdown (MultiSelect, ShowChips, FuzzySearch, SelectionChanged, ClearSelection) and the two modes of ComboBox (Editable, AllowFreeText, SelectedIndex) on one list of ChoiceItem with groups, detail texts and a disabled item. Settings has Switch rows (Description, Small) and a button that opens a ChoiceList (Open, SetItems, IsSelected, Highlight, MoveHighlight, PickHighlighted, Picked) with two groups and a disabled row. States shows one control of each kind as normal, disabled (SetEnabled), read-only (isReadOnly, Rating.ReadOnly) and with an error (FieldError.Show, FormField.Error). Look restyles the controls with the USS class form-demo-look only; a Switch turns the class on and off.
NumericUpDownDemo.unity NumericUpDownDemoController Four NumericUpDown uses, one per tab, with Decrement, Increment and Reset buttons (Decrement, Increment) and a status label fed by the change events. Bounty: the reward of a bounty with the defaults. The field takes a sum such as 50*4. The tab sets the label, the Step and the FormatString; a format that is not for a number shows an error with FieldError.Show and keeps the old format. Stack split: the health potions to take from a stack, from 1 to one less than the stack (MinValue, MaxValue). Split moves them to a new ItemSlot (Icon, Count, MaxStack), and the tab sets the stack size and the Step. Crafting: the stone axes to craft, up to what the wood and the stone in the bag allow (MaxValue). Craft spends the materials, and the tab sets the wood and the stone. Settings menu: volume, mouse speed, field of view and a frame limit, each with its own FormatString (P0, F2, 0 fps). They sit in option rows that Up and Down move between, so a gamepad reaches each row. The tab sets the range of the mouse speed and turns on a game look. Each tab shows the UXML and C# of its use, and the settings tab its USS too.
ComboBoxDemo.unity ComboBoxDemoController Four ComboBox uses, one per tab, with Open, Clear and Reset buttons (Toggle, SelectedIndex) and a status label fed by the change events. Mount name: a name that the player picks from the Choices or types, with the defaults. The tab sets the choices, the Placeholder, Editable and AllowFreeText. Resolution: a screen size that takes no typing (Editable off), where a typed digit goes to the next size that starts with it. Each ChoiceItem has its aspect ratio as the Detail, and GroupOf groups the sizes by aspect. The 4K size is off (ChoiceItem.Enabled) until the 4K screen toggle is on. Server region: regions in groups by continent (ChoiceItem.Group), with rows of the controller (MakeItem, BindItem) that show the ping in a colored dot, and a region that is down for maintenance. Join joins a match on the SelectedItem. Looks: a difficulty that a gamepad picks, a game look that the open list takes from its tb-style-scope, the disabled field and an error with FieldError.Show. Each tab shows the UXML and C# of its use, and the looks tab its USS too.
SearchDropdownDemo.unity SearchDropdownDemoController Five SearchDropdown uses, one per tab, with Open and Clear buttons (Open, ClearSelection) and a status label fed by SelectionChanged and QueryChanged. Stash: an item to find in the bags of a stash, with the defaults; a pick shows its bag and slot. The tab sets the Placeholder, FuzzySearch, ForgiveTypos, HighlightMatches and KeepQuery. Market: wares as ChoiceItems with an icon, a price as the detail and hidden Keywords, in groups by type (GroupOf). A soulbound ware is not for sale (enabled: false), and the last picks come first (RecentCount). The tab turns the groups on and off and sets RecentCount; Buy buys the picked ware. Party invite: friends to invite with MultiSelect, ShowChips and ShowClearButton, where Backspace removes the last chip. The tab sets these and ShowSelectedCount, and Invite sends the SelectedItems and clears them. Find a player: an AsyncSearch that asks a slow server when the typing stops (SearchDelay), while the list shows that it is searching (IsSearching). For a query shorter than MinSearchLength, the list shows the recent players and their last match from Items. The tab sets both and the reply time of the server, a label counts the server calls, and Add friend sends a request to the picked player. Looks: a place to fast travel to, a game look that the open list takes from its tb-style-scope, the disabled field and an error with FieldError.Show. Each tab shows the UXML and C# of its use, and the looks tab its USS too.
AutoCompleteFieldDemo.unity AutoCompleteFieldDemoController Four AutoCompleteField uses, one per tab, with Try it, Show all and Clear buttons and a status label fed by ItemPicked and the word at the caret (CurrentQuery, Matches). Player name: a field that completes the names of its choices attribute with no code; Tab or Enter takes the choice, and Invite or Enter again adds the player to a party of four, shown as ListItem rows with a UserAvatar and a Badge, and an open slot for each free place. The tab sets the label, the placeholder and Choices. Chat: a guild chat line where SetProvider gives "@" the players, "#" the channels and "/" the commands, the commands only at the start of the line (CompletionQuery.Before); each ChoiceItem has an InsertText with a space after the name, and Enter sends the line. A sent line is an AnimatedLabel that highlights a known @player and underlines a #channel, and Up recalls the sent lines (HistorySize, AddToHistory). The tab turns each trigger on and off and sets the size of the history. Server search: SetAsyncProvider asks a slow server with a cancel token, so a newer word cancels the older request, and the pick shows on a Card; the tab sets the delay of the server and the region. Spells: Items of ChoiceItem with icons, groups by school, the mana cost as the detail and a Locked spell, and the pick goes on key 1; the tab turns the icons and the groups on and off and colors the gray text with a USS class. Each tab shows the UXML and C# of its use; Spells shows its C# and USS.
MaskedTextBoxDemo.unity MaskedTextBoxDemoController Four MaskedTextBox uses, one per tab, with Try it and Clear buttons and a status label fed by UnmaskedText and IsComplete. Friend code: the read-only code of the player (isReadOnly) with a Copy button, and a 0000-0000-0000 box for the code of a friend whose dashes fill in by themselves; Send or Enter checks IsComplete and the code, and shows the reason under the box with FieldError.Show. The friend list is ListItem rows. The tab sets the label, Mask and PromptChar. Redeem code: an AAAAA-AAAAA-AAAAA box that takes letters and digits in any case, and Redeem shows the reward of each code once on a Card; the tab sets value, shows UnmaskedText and turns read only on and off. Date of birth: a 00/00/0000 box that DateTime.TryParseExact reads, and Continue opens or closes online play by the age; the tab swaps the Mask and the order of the date (DD/MM/YYYY, MM/DD/YYYY or YYYY-MM-DD) and sets the minimum age. Looks: a box that is empty, partly filled, complete, with an error, read only and disabled; the tab sets a code font, the color of the incomplete border (warning, danger or none) and the error. Each tab shows the UXML and C# of its use; Looks shows its USS and C#.
InputGroupDemo.unity InputGroupDemoController Five InputGroup uses, one per tab, with Try it and Clear buttons and a status label. Search: a search of the bag in a SearchField (a magnifier that stays while the player types, the clear button and a placeholder that follows the language) with a Kbd key hint; the items filter on SearchChanged as the player types, and Ctrl+F goes to the search. The tab turns the clear button, the icon and the key hint on and off and sets the placeholder. Gold amount: a bid at an auction from a group with a coin, a NumericUpDown, a unit and a Max button; Bid checks the amount against the top bid and the gold of the player, and shows the reason under the whole group with FieldError.Show. The tab sets the unit, the coin, the Max button and the gold of the player. Server address: a scheme, a host, a colon, a port and a Connect button in one border; Connect or Enter checks the host and the port, connects to a known server or says that no server answers, and the recent servers fill the address. The tab sets the prefix, hides the port and sets the text of the button. Looks: icon, text, key hint and button addons, the accent border of a group whose field has the focus (FOCUSED_CLASS), an error and a disabled group; the tab sets a filled text addon, square or round ends and the error. Watermark: a song name with a note icon and a text as the Watermark of an InputGroup, and a price with a spinning AnimatedImage coin; the watermark shows while the field is empty; Try it fills the name, and the tab sets the text, the icon and hide-watermark-on-focus. Each tab shows the UXML and C# of its use; Looks shows its USS and C#.
DisplayDemo.unity DisplayDemoController The display controls by use, one window for each, with the UXML of the live controls in a CodeBlock and a status line for the clicks. Friends: ListItem rows (Title, Description, Clickable, Clicked) with a UserAvatar in Media, a dot Badge on the corner (Dot, Corner, Tone) and an action button; a name filter and an online toggle hide rows, and an EmptyState (Title, Description, an action button) takes their place when none is left. Shop: Card elements in a wrap layout with a price Badge in Action, a square UserAvatar (Square, Size), rarity and "NEW" badges (Outline) and a Buy or Sell button in Footer; the Arcade look restyles the cards with USS only. Party: an AvatarGroup (Max, Refresh) with its "+N" count in the action place of a Card; buttons add and remove members, and fields set Max, Size and Square. Badges: a mail count (Count, MaxCount, Corner; 0 hides it), a tag that follows Tone, Outline and Dot, and filter badges (Clickable, Clicked). Menu: Separator lines in a row (Vertical) and a column, and a line with a label made of two separators and a Label. Empty states: three EmptyState cases with one or two action buttons. Inline icons: an InlineIconLabel (Text, Family) with a gamepad button, a PromptFont glyph and two icons from InlineIconLabel.RegisterIcon; a text field, a family dropdown, a font size slider and a Narrow toggle change the label, buttons add a name in braces, and the UXML and the C# show in CodeBlocks.
CommandDemo.unity CommandDemoController Commands and keys, one tab for each use in a Commands window. The Preview card shows the game for every tab: a ToolBarMenu with Hero, View (Windows and Theme submenus) and Cheats menus over the Hero panel (a StatBar for health and a ResourceCounter for gold), the buttons of the palette (Ctrl+K) and the console (F2) with their Kbd keys, and one status line for the commands and the key changes. Commands: one list of game commands fills a CommandPalette and the menu bar; a command changes the hero, opens the window or sets the theme, a condition turns a command off (ChoiceItem.Enabled, MenuItem.EnabledPredicate), and a CodeBlock shows the C# of the list. Key bindings: KeyBindingField rows in one conflict group with the conflict callout and a reset button; a row with the name of a command gives its key to the palette, the menu bar and a Kbd in the Hero panel. Console look: a second palette (F2) with the same commands, restyled as a green-on-black console in CommandDemo.uss. The KbdDemo and GamepadGlyphDemo examples show the looks of Kbd and GamepadGlyph.
PropertyGridDemo.unity PropertyGridDemoController PropertyGrid by use, in six tabs. The Preview card shows the grid of the selected tab, with its PropertyValueChanged status under the stage; each tab holds its fields and the C# class that its grid edits in a CodeBlock. Ship inspector: Target is a ship and a ship above the grid follows each change; [Category], [Description], [Range] and [EnabledIf] make the groups, the help text, the sliders and the disabled row. A text or number field sends its change on Enter or when it loses the focus. Field types: one row for each type (text, multiline text, int, float, sliders, bool, enum, flags, Color, Vector2, Vector3, DateTime, TimeSpan, a nested object, a list), with declared-category-order, Undo, Redo, CanUndo, CanRedo, GetItem and InsertElement. Cheat panel: [Choices] on a string and on an int, [EnabledIf] with a value, [InspectorName] and [DisplayName], [ReadOnly], a readonly field, a property without a public setter, [Browsable(false)], [HideInInspector], and Refresh after code changes the object. Search and sort: SearchText, SortMode, DeclaredCategoryOrder, ShowSearch, ShowClearButton and ShowDescription, with the UXML of the grid. Two objects: one grid for two ships and two heroes; a new Target builds the rows again and clears the undo history. Custom look: a spell book look from the USS class property-grid-demo-look, and RegisterEditor with an editor that writes through SetValue.
DialogDemo.unity DialogDemoController The Dialog, one tab for each use. The Preview card shows the ship panel of the tab with the buttons that open the dialogs, and a status label with each result; the dialogs open over the workspace. Dialog: a rename form declared in UXML with a footer, ShowAsync with the name of the footer button or Dialog.DISMISSED, the options CloseOnEscape, CloseOnOutsideClick, Closable, Glass and GlassOverlay, and a chain: a footer button without a name opens a MessageBox over the dialog, and Close(result) closes it. Event choice: an event of the game as a dialog that the code makes, with a button for each answer; an answer changes the fuel, credits and honor of the ship, and an answer that costs too much is disabled. Look: the class dialog-demo-console restyles a box and the dialog, and a box with a Timeout counts down on the button of its CancelResult. Each tab shows the UXML and the C# call of its last box or dialog, and the Look tab the USS of the look.
MessageBoxDemo.unity MessageBoxDemoController Four MessageBox uses on the console of a ship, one per tab, with a button that shows the box of the tab and a status label with each result. Question: ShowAsync with the MessageBoxButtons set and the MessageBoxIcon of the fields; Enter chooses the first button and Escape gives the CancelResult of the set, and the tab sets Modal, Glass and GlassOverlay. Confirm: MessageBox.ConfirmAsync before a save slot goes, with the action text, the icon and the danger look (destructive); Cancel has the focus. Own buttons: a choice of docking bay with AddButton(text, id) and DefaultButton; the box gives MessageBoxResult.Custom, and CustomResult has the id. Countdown: a box declared in the UXML with a Timeout, after a change of the display mode; the tab sets the seconds and TimeoutResult, and No puts the old mode back. Each tab shows the UXML and C# of its use.
DrawerDemo.unity DrawerDemoController Four Drawer uses on the bridge of a ship, one from each Side, with a button for each drawer (Toggle) and a status label fed by Opened and Closed. Cargo hold: the defaults, a modal drawer from the left; the tab sets the Side, CloseOnOutsideClick and Closable. Settings: a drawer from the right with a Done button in its footer (tb-drawer__footer) that calls Close; the tab sets the width (Size). Messages: a tray from the top; the tab sets its height. Crew sheet: a drawer from the bottom with ShowHandle, and SnapPoints at 40 % and 90 %. Each tab has a Modal toggle: with it off, the windows and the other drawers stay in use. Each tab shows the UXML and C# of its use.
AlertDemo.unity AlertDemoController Alert in five screens of a game, one per tab, with a Reopen button and a status label fed by Closed. Quick start: an alert with only a message above the save slots of a menu; the tab sets Severity, Title, Description and Closable. Settings screen: a warning when the textures need more video memory than the card has, with a Use action that picks the best textures that fit, and an error when the Dodge key is bound to another action, with Swap keys and Undo actions; the error keeps Apply off, and a success follows Apply. Buttons in an alert are its actions; the tab sets the video memory and whether the checks are closable. Store: one alert tells how each purchase went: the code sets its Severity, Title and Description, and shows a Get gold action for the error; the tab sets the gold and the free slots of the bag. Connection: a lost connection opens an error with no close button, and the code closes it with Close after the reconnect; a high ping opens a warning; the tab sets the ping and drops the connection. Looks: the four severities in a quest log, with Tinted, Parchment and Terminal looks in USS; the tab sets the look, the icons and Closable. Each tab shows the UXML and C# of its use; Looks shows its UXML and USS.
HoverCardDemo.unity HoverCardDemoController Four HoverCard uses, one per tab, with Open from code and Close buttons and a status label fed by Opened and Closed. Items: a backpack of ItemSlots with a ResourceCounter for the gold; each card names its slot with the target attribute and needs no code, the Rarity of the slot colors its border, and a rarity class colors the border of the card; the tab sets OpenDelay and CloseDelay of all the items and the Title and Text of the Healing tonic. Party chat: one card serves all the names of a chat and fills itself in Opened from Target, with a UserAvatar, an online Badge and Whisper and Invite buttons; the tab sets Placement and Alignment. Skill bar: one card serves the six AbilitySlots of a skill bar, with the mana and the cooldown as Badges and the key as a Kbd; a click or a number key casts the skill with AbilitySlot.Press; the tab sets HighlightTarget, TipSize and OpenDelay. Looks: the people of a town, each card in the colors and the font of its kind; the tab sets the Look (CalloutLook) and the TargetMark of their cards. Each tab shows the UXML and C# of its use, and Looks also shows its USS.
LoadingScreenDemo.unity LoadingScreenDemoController Four LoadingScreen uses between the places of a small game, one per tab. The Continue button shows the screen of the tab over the demo with Show, runs a short job in steps, moves the game to the next place under the screen and ends with CompleteAsync; no other scene loads, and the status shows how long the screen stayed (Opened, Closed). Quick load: a screen with no setup, "Loading" and a spinning ring; the tab sets Title and MinimumTime. Between levels: the Title names the next place, the ring follows Progress and the Tips fade in turn; the tab sets the tips, TipDuration and MinimumTime. Behind the screen, a LoadingBackdrop shows the art of the next place, with layers that pass by. World build: a bar (Indicator) and a Title for each stage of the job; the tab sets the indicator and a known or unknown length (a Progress of -1 runs the bar). A knight walks along the bar with a LoadingRunner, an AnimatedImage that plays the walk clip of a SpriteSheet while it moves, and to and fro with an unknown length. Story chapter: parchment as Background, lore that types itself in (TypeTips), and PressAnyKey with a PromptGlyph, so the screen waits for a key (IsWaitingForKey); the tab sets the art, the key and the glyph. Each tab shows the UXML and C# of its use, and Story chapter also shows its USS.
WizardDemo.unity WizardDemoController Three Wizard uses in a game, one per tab, in a preview with Start again (Reset) and a status label fed by StepChanged, Completed and Cancelled. Character: a hero in three steps with the defaults; the tab sets ShowProgress, ShowStepNumbers, AllowStepClicking and FinishText. New game: WizardStep.Validator with ShowValidationError in the line or at the field, an Oath step with a VisibilityCondition that shows it only for Ironman, and a CancelConfirmation with MessageBox.ConfirmAsync; the tab sets the letters a name needs and turns the question before a cancel on or off. Tutorial: a Look step with CanSkip and CanGoBack, and SaveState and RestoreState to come back to a place. Each tab shows the UXML and C# of its use.
DragDropDemo.unity DragDropDemoController DragSource and DropTarget in six tabs and two more windows. The places of the selected tab show in a Preview card, and the buttons, the fields and the code of the use are in its tab. Each button does the action of a drag through DropTarget.At(element).Drop(data), so the keyboard and a gamepad work. One status label under the Preview reports each drop: the item, the source place, the target place, accepted or denied. Build queue: each row is a source and a target; a drop puts the dragged row at the place of the other row. Crew board: three columns; the canDrop filter of In work counts its cards against a limit field, so a full column gets tb-drop-target--denied. Party: a slot takes only a hero of its role, and a full slot sends the other hero back to the roster; DragSource.Denied and Ended report a denied drop and a release over no target. Hotbar: the dropped callback decides: a spell from the book goes into a free slot as a copy, a spell from a slot moves or swaps, and the trash holds one spell until Undo. Bench: two slots take only an ingredient and a label shows the recipe result; a field sets DragSource.Threshold on all sources, and a Look field restyles tb-drag-ghost, tb-drag-source--dragging, tb-drop-target--hover and tb-drop-target--denied and shows the USS. Two windows: crates go between the Cargo hold and Dock windows; the ghost is in the workspace above all windows.
KanbanDemo.unity KanbanDemoController A task board in the style of Trello. Each column is a Card with a vertical ScrollView, and each ScrollView is a list DropTarget: a drag shows the tb-drop-insert line at the place of the drop, and the drop puts the task there. A drag near the edge of a column, or of the board, scrolls it (DragSource.AutoScroll). The canDrop filter of In work keeps it to three tasks, and the count badge of each column follows. Move left, Move up, Move down and Move right act on the selected task through DropTarget.Drop(data, index), so the keyboard and a gamepad work. A text field adds a task to the Backlog.
DirectorDemo.unity DirectorDemoController A small video editor in one window. A VideoView (show-controls="false") plays VideoSample.mp4, and a Timeline with edit-items holds the script of the clip on four tracks. Titles set the text and the TextEffects of an AnimatedLabel over the picture. Captions type a TypewriterLabel with their TextEntry and effect tags; its Elapsed follows the video time, so a pause or a seek shows in the caption. Effects add their effects to the caption. Sound items fade the Volume of the video to their level. The video's TimeChanged moves the playhead, and PlayheadMoved seeks the video (a flag skips the seek for a set from code). A drag of an item changes its time (ItemChanged), the inspector edits the selected item (ItemSelected, a checkable ContextMenuComponent for the effects), and a script list of ListItem rows jumps to a caption. On a gamepad, A on a palette tile adds an item at the playhead, and A on the timeline grabs the selected item, the D-pad moves it, A drops it and B puts it back. A frame of playback makes no garbage.
TermsDemo.unity TermsDemoController The first-launch screen of a game. The terms are a MarkdownView with headings, lists and a tip, in a focusable ScrollView, in a window over the title art, a pixel art PNG that Tools/skins/terms.mjs draws, shown at a whole zoom. "I accept" stays disabled until the player reaches the end of the text: the valueChanged of verticalScroller and the GeometryChangedEvent of the view and the text measure how far the player has read, and a thin StatBar and a hint with InputGlyph prompts show it. A ToolTip on an enabled holder around the disabled button says why. The wheel, a drag of the bar, Page Up, Page Down, Home, End, the arrows and the d-pad all move verticalScroller, so each one counts. When the text fits with no scroll bar (a maximized window), "I accept" is enabled at once. "I accept" closes the window, shows a toast and a "Press start" title with AnimatedLabel text; Decline asks first with MessageBox.ConfirmAsync. The toolbar button shows the terms again from the start.
MonthCalendarDemo.unity MonthCalendarDemoController Four MonthCalendar uses, one per tab, with a status label for the events of the tab. Default: a calendar with no settings that starts at today, with Go to today and Clear selection buttons; the fields set selection-mode, show-week-numbers, show-today-button and month-count, and the status shows DatePicked and SelectionChanged. Guild events: one season of a guild with min-date and max-date, closed Mondays (IsDateEnabled), and festival and raid days marked with a class after each MonthChanged; Next event goes to the next marked day. Views: Days, Months and Years buttons for View, and fields for FirstDayOfWeek, Culture, the week numbers and month-count. Looks: the Almanac and Starlight looks, each one class on the calendar. Each tab shows the UXML and C# of its use.
DatePickerDemo.unity DatePickerDemoController Three DatePicker uses, one per tab, with a status label. Default: a field with no settings that holds today, with an Open button; the fields set label, format, show-time and range. Quest dates: a deadline with a format between min-date and max-date (Ask for 15 July shows the limit), a voyage as a range with Presets and two months, and a muster with a time of day (show-time). Inn stay: a stay as a range over a month end (range, range-end, RangeChanged), with One night and A week buttons that call SetRange, the nights and the price in gold, and a Two months field for the popup. Each tab shows the UXML and C# of its use.
TimePickerDemo.unity TimePickerDemoController Three TimePicker uses, one per tab, with a status label. Default: a field with no settings, with an Open button; the fields set clock and minute-increment, and the value changes only when the columns are accepted. Shop hours: the opening and closing time of a shop and a wake-up bell on the 12-hour or the 24-hour clock; Open late closes the shop after midnight, and Usual hours sets them back. Day and night: the time of a game world sets the class of the sky and the place of the sun; Dawn, Noon, Dusk and Midnight jump to that time. Each tab shows the UXML and C# of its use.
TimeSpanPickerDemo.unity TimeSpanPickerDemoController Three TimeSpanPicker uses, one per tab, with a status label. Default: a field with no settings, with Minutes down and Minutes up buttons; the fields set format, input-mode, show-labels, steps and snap-to-step. Durations: game timers with format, units, steps, snap-to-step, min-value, max-value and the Text input mode; Forge - 15 min and Forge + 15 min step the forge time. Charter: a DatePicker, a TimePicker and a TimeSpanPicker give the departure and the arrival of a ship in one sentence; the fields set the format of the voyage and the clock of the departure. Each tab shows the UXML and C# of its use.
WeekScheduleDemo.unity WeekScheduleDemoController Four WeekSchedule uses, one per tab, with a status label for the events of the tab. Default: a schedule with no settings and three events this week, with Back, Today and Next buttons (Page, GoToToday); the fields set view, slot-minutes, hour-height, show-header and show-calendar. Guild week: events to drag and resize, a locked event, one over midnight, a click on an empty slot that books a quest (SlotClicked), Remove selected, and No double booking (AllowChange); the Clock stands still, so the now line stays where it is, and the fields set the now line, editable, slot-minutes and the hours. Blacksmith's day: one day under a game clock (Clock, RefreshNow), where the task under the clock is selected; Next task jumps to the next task. Looks: the Parchment and Neon looks, one class on the schedule, and a class on each kind of event (ClassName). Each tab shows the UXML and C# of its use.
AnalogClockDemo.unity AnalogClockDemoController Three AnalogClocks and the code of each, in three tabs. Clocks: the time of the device, which keeps up by itself and draws once a second, with toggles for the second hand, smooth seconds (a draw on every frame), the minute marks and the numbers. Game time: a game world clock that the game sets every half second, with the night as a band on the face and a Day or Night Badge. Alarm: a clock that the user sets with a drag, the arrow keys or the right stick (the step is 1, 5 or 15 minutes); A starts the edit on a gamepad, A again keeps the time and B puts it back.
AssignListDemo.unity AssignListDemoController An AssignList that picks a party of four heroes from six, with portraits in the rows. Move a hero with the buttons, a double click, a drag or A on a gamepad; a StatTile row sums the attack, the defense and the magic of the party, and the Party size list sets the limit (2, 4 or 6).
CircleLayoutDemo.unity CircleLayoutDemoController Two CircleLayouts and the code of each, in two tabs. Radial menu: six buttons spread over the full circle, with sliders for the radius, the start angle and the sweep, toggles for the direction, turned items and animation, and buttons that add and remove an item. Skill arc: five buttons that step by a spacing from the start angle, with the align, the spacing and the mode. The d-pad moves the focus around the circle.
HexGridDemo.unity HexGridDemoController Two HexGrids and the code of each, in two tabs. Skill board: ten icon cells in pointy-top hexagons, with sliders for the columns, the cell size and the gap and a toggle that draws the hexagons. Terrain map: twenty-one flat-top cells with a dropdown for the orientation and sliders for the columns and the size. A Card beside each grid shows the selected cell. The d-pad moves the focus to the nearest neighbor.
CodeDemo.unity CodeDemoController CodeBlock by use, in three tabs, with the blocks of the selected tab in a Preview card. Snippets: a CodeBlock with Code, Title, ShowLineNumbers, ShowCopyButton, Copy() and Copied, in the theme look, a Terminal look and an Accent look. Syntax colors: language on a sample of each CodeLanguage, the dark and the light default colors with a ThemeSelector, and a block with own colors from the --tb-code-* custom properties. Tutorial: three CodeBlock steps; Copied marks a step as done and opens the next. The status under the preview reports the events of the selected tab, and each tab shows its fields and its code in a CodeBlock.
LogViewDemo.unity LogViewDemoController Three LogView uses, one per tab. The Preview card shows the log of the tab, with Copy() and Clear() buttons and a status label fed by Changed and Copied. Game log: a log with the defaults (a toggle for each kind with its count, a text filter, Follow, Clear and Copy) and an entry of each kind; the error has a stack trace that shows in the detail under the list. Log, Warning, Error and Command buttons call Add with each kind, and the tab sets Follow, ShowClearButton and ShowCopyButton. Combat log: max-items and a look from LogViewDemo.uss with no bar and a color for each LogEntryKind; Hit, Critical hit, Ability, Loss and Fight 10 rounds add lines, and the tab sets MaxItems and Follow. Unity log: capture-unity-log shows the messages of Debug.Log, Debug.LogWarning and Debug.LogError, and a toggle sets CaptureUnityLog. Each tab shows the UXML and C# of its use, and the combat log its USS.
CodeInputDemo.unity CodeInputDemoController Three CodeInput uses, one per tab. The Preview card shows the input of the tab, with Clear and Focus() buttons and a status label. Room code: six digits with the defaults. The tab sets label, characters, upper-case, masked, length, group-size and separator, and the status shows value, IsComplete and the Completed events. Gift code: eight letters and digits in two groups of four. Completed checks GOLD-2024 and WOLF-0007 with no regard to case; a wrong code gets the error look of FieldError and empties the boxes. Two buttons set value as a paste does, and the tab sets upper-case and separator. Vault PIN: a masked PIN of four digits with three tries. The right PIN or the last wrong try disables the field, and Start again gives the tries back. The tab sets masked and gives the boxes three looks with classes from CodeInputDemo.uss. Each tab shows the UXML and C# of its use, and the PIN its USS.
SpellCheckFieldDemo.unity SpellCheckFieldDemoController Three uses of SpellCheckField and its SpellCheck manipulator. The Preview card holds a biography, a row for each wrong word from SpellCheck.Errors and a party chat line. Each row has the SpellChecker.Suggest words and Add to dictionary. The card has Fix all words, Add the names and Start again buttons, and a status label fed by Checked. A right-click on a wrong word, or Shift+F10, opens its suggestions, Add to dictionary and Ignore. Biography: the tab sets label, multiline, is-delayed and password; a password field is not checked, and Check() checks again. A class on the field gives the wave the accent or the warning color instead of the danger color of the theme. Chat line: AddManipulator gives a plain TextField a SpellCheck that shares the word list, and RemoveManipulator takes it away. Word list: IsCorrect and Suggest for a word of the game, AddWord, AddedWords and WordAdded; each field that uses the list checks again. Each tab shows its code, and the biography its UXML and USS.
LayoutDemo.unity LayoutDemoController The layout controls by use, in six tabs. Codex: a SplitPanel with a list pane and a second, nested SplitPanel for the text and the notes; Sizes gives the start position, MoveSplitter, CollapsePane, ExpandPane and Vertical change it from code, min-pane-size and the USS min-width/max-width of a pane limit it, and SizesChanged and PaneCollapsedChanged report it. Game menu: a Sidebar with SidebarGroup and SidebarItem elements, sub-items, a header and a footer; ItemSelected shows the page of the item, and Selected, Collapsed, Toggle, shortcut, Side and Badge.Count change the menu. Quest journal: an Accordion of Foldout sections with Multiple, Collapsible, the Opened event, and open and close from code through the value of a section. Tutorial: a FlipView with Next, Previous, SelectedIndex, Loop, AutoAdvance, Transition, ShowArrows, ShowIndicators and SelectionChanged. Heroes: a FlipView with several cards (AddPage, ItemsPerView, Spacing, Alignment, StepSize, GoTo on a click) and a custom look in USS for the view, the cards, the selected card and the dots. Settings: a Sidebar that selects an Accordion page, beside a SplitPanel whose second pane is a FlipView with the help. Each tab reports the events in a status label and shows the UXML of the live control in a CodeBlock.
NavigationDemo.unity NavigationDemoController Breadcrumb, Pagination and Alert by use, in two windows. World map: a path of galaxy, sector, system and planet; a place button calls Push, SetChoices gives the segment an arrow with the places next to it, a segment click raises Navigated, a menu pick raises ChoicePicked, and Up one level calls NavigateTo. Bag: the path of the open containers with max-visible and its menu of hidden segments, separator, separator-class for a chevron drawn in USS, and a Pills look. Shop: 60 wares in pages with SetItemCount, PageChanged, PageSizeChanged, show-labels, show-first-last, sibling-count, page-sizes and page-size; a price filter sets the count again, and each ware is a ListItem with its price at the right. Codex: one entry on a Card with page-count and Page, a Dots and a Small look in USS, and Pagination.PagesToShow. Messages: four alerts with severity, title, message (rich text), closable and child buttons as actions; Close, Closed, Open and IsOpen. Settings: a form where a restart alert opens with a new Description while a setting waits and closes when it does not, and a closable saved alert that comes back. HUD banner: one alert takes Severity, Title, Description, Closable and actions from fields, with a Banner and a Strip look in USS. Each tab reports its events in a status label and shows the UXML or C# of the live control.
PanZoomDemo.unity PanZoomDemoController Three PanZoomView uses, one per tab, each with the zoom indicator in its bottom right corner (minus, the zoom in percent, plus), a Fit all button and a status label fed by ViewChanged. Image viewer: a picture that fits on start with FrameAll, with scroll bars; the tab sets the max zoom, the scroll bars, the zoom indicator, the clamp to the content and the pan button. Map with pins: a large map with four pins that zoom to their place with FrameRect; the tab sets the min zoom and the wheel zoom. Canvas: notes on a grid that pans without end (clamp-to-content off); the tab sets the grid and its size, and Add a note puts a note at the middle of the view with ViewToContent. On a gamepad, the right stick pans and the triggers zoom while the view has the focus. Each tab shows the UXML and C# of its use.
PopupDemo.unity PopupDemoController The building blocks under the ready overlays, in one AnchoredPopup window with a tab for each use. The Preview card shows the anchor of the tab and a status label; the popups and the banner open over the workspace. Item actions opens a menu under a bag slot with Open(anchor, keepOpenOn, matchWidth); a click outside, a second click on the slot, or Escape closes it, and Closed reports. Map point opens a menu at the pointer with OpenAt(anchor, worldPosition) and shows that the popup stays inside the workspace. Submenu opens a second popup beside a row with OpenAt(row, point, owner: menu); the owner closes its child. Look puts the chest button in an element with the class tb-style-scope (AnchoredPopup.STYLE_SCOPE_CLASS); the popup takes the look class of that element, which sets the --tb-* variables. Overlay shows LevelUpBanner, a control of the example derived from OverlayElement: ShowOver, FocusFirst, HideOverlay, IsModal, Dismiss, UpdateModal, OnRemoved, and the --hidden, --anim-in and --anim-out classes; it can be modal or not. Picture captures a hero card with ElementImage.Capture(element, done) into an Image, and states the limits. Each tab reports its events in the status label and shows the C# of its call in a CodeBlock, and the Look tab its USS.
InputDemo.unity QuickTimeDemoController Quick time events from an AutoClickButton, in three tabs. The Preview card shows the prompt of the selected tab, with the hint of the tab in its description; the bar under the stage holds the Look field and the status of the tab. Timed press: the click of the user is a hit and the click of the time is a miss (ClickedByTime), Elapsed is the reaction time, and each hit makes the next time shorter. Hold: the press calls Restart, the release calls Cancel, and a ProgressRing shows Progress. The "Reset on release / Drain slowly" switch of the Hold tab changes the hold: with Drain slowly the release calls Drain, so the ring falls at DrainRate (the drain speed slider, a part of the ring each second), and the next press calls Continue to go on from there. Tap: each tap fills a StatBar that goes down with the time; a full bar stays full, sends sparks from a ParticleLayer in the accent color of the theme, and the next tap starts again. A hold that comes to its end sends sparks in the success color. The sparks play once for each success, and the animations switch of the Workspace turns them off. The Look field changes the prompts from key caps to gamepad buttons with one class. The keys are E, F and Q; the gamepad buttons are X, Y and RB. A Kbd or a GamepadGlyph next to each text shows the input. In the key look the time fills the key; in the gamepad look a GamepadGlyph in the prompt shows the time as a ring (Progress). The keys come from the KeyDownEvent and KeyUpEvent of the panel, so they work without the Input System. Each tab shows the UXML and C# of its use in CodeBlock controls; the code follows the time, the hits, the holds, the bar and the look. The KbdDemo, GamepadGlyphDemo and InputGlyphDemo examples show the looks of the prompts.
GamepadGlyphDemo.unity GamepadGlyphDemoController Four GamepadGlyph uses, one per tab, with Previous and Next prompts under the stage that select the tab (also with the shoulder buttons of a gamepad) and a status label. Families: each GamepadGlyphButton in each GamepadFamily on wood, with a size slider and the colored class. Button hints: the hint bar of an inventory (Use, Drop, Sort, Back); a Device field picks a gamepad layout, GamepadGlyph.FamilyOf turns it into a family, and the hints, the prompts under the stage and the hold prompt follow it. A gamepad that the player uses sets the field. Hold: hold E, Y or the pointer on the chest; the ring of the glyph (Progress) fills, and a full ring opens the chest with confetti. A release empties the ring; a slider sets the hold time and a toggle hides the ring track. Binding: a Gamepad KeyBindingField, a family field, the colored class and a Progress slider; GamepadGlyph.TryGetButton turns the binding path into the button of a large live glyph. Each tab has its UXML and C# (and USS for the hold) in CodeBlock controls that follow the fields.
DeviceSwapDemo.unity DeviceSwapDemoController A DeviceSwap that swaps a keyboard hotbar (keys 1 to 8) for a gamepad crossbar (two diamonds of AbilitySlots with GamepadGlyphs), in three tabs. The Preview card has buttons that switch the device by hand with LastInputDevice.Set, and a ChoiceList that picks the transition. The tabs show the UXML and C# of each use; see DeviceSwap.
InputGlyphDemo.unity InputGlyphDemoController Three InputGlyph uses, one per tab, with Previous and Next prompts under the stage that select the tab (also with PgUp and PgDn) and a status label. Tutorial: the prompts of a game tutorial (jump over the wall, move, aim, shoot) over a rooftop, where each jump sends a runner over the wall, and a device badge follow the device that the player uses; a key or a click sets the mouse and keyboard, and a gamepad button or stick sets Xbox or PlayStation. An Input field sets the device, and a Follow toggle stops the follow. Looks: nine glyphs in a row and an "Open the door" prompt whose glyph name, size, tint, ring progress and ring track come from fields; a text that is not a glyph name shows as it is. All glyphs: a grid with a glyph for each PromptFont.Names entry and a search field; a click selects a glyph and shows it large with its name. Each tab has its UXML and C# (USS for the looks) in CodeBlock controls.
InputEchoDemo.unity InputEchoDemoController The InputEcho in two tabs. The Preview card shows the view of the selected tab, with the hint of the tab in its description. Echo: a knight in an arena that WASD, the arrow keys or a stick move while the game view has the focus, with the toasts of each key, combo, repeat, hold, click and gamepad button in a corner; fields for every member, an Echo button that calls Echo and a Clear button. Streamer: a game view with a LIVE badge, the toasts at the bottom left and a compact InputViewer at the bottom right. Under the stage, a Type here field and a password field show the hide rule, and a label shows the last toast from Echoed. Each tab has its UXML and C# in CodeBlock controls.
InputViewerDemo.unity InputViewerDemoController The InputViewer in two tabs. Keyboard: the full keyboard and the mouse, with fields for the device, the layout, the mouse, the fade, the hide rule and the pause. Gamepad: the gamepad with its stick trails and trigger fills, and fields for the trail length, the fade and the pause. Under the stage, a Type here field and a password field show the hide rule. Each tab has its UXML and C# in CodeBlock controls.
AlertStripDemo.unity AlertStripDemoController The alert icons of a grand strategy game from an AlertStrip, one tab for each use. The Preview card shows the screen of the tab and a status label. Grand strategy: a strip on the top bar of a parchment map, where each region is a pin on its province. A day clock raises alerts, makes their count grow and resolves them; the count sets the Severity, and an Error alert flashes and plays the notification sound. Hover an icon for the details, click it to show its region on the map (Clicked), click the region to fix the cause (Remove), or right-click the icon to snooze it (Dismissed). The Raise buttons of the tab add one to each kind. City builder: a vertical strip on the side of a city, with tooltip-placement="Right". The toggles and the slider of the tab set the alerts; a click on an icon sends help. Each tab shows the UXML and the C# of its strip.
ItemCompareDemo.unity ItemCompareDemoController The item compare of a game from an ItemCompare with a StatDelta in each row, in two tabs, with the cards and the inventory of the selected tab in a Preview card. Weapons: the equipped sword and a second sword as cards. Hover or focus a sword in the inventory to compare it, and click it to equip it. One arrow is a change under 10%, two under 25%, three more; green is better and red is worse. The rune blade and the dagger have a stat that the others do not have, so the compare shows a row for it. The footer is the sum of the stats. Armor: a weight and a move penalty where less is better (HigherIsBetter false), so a lighter armor shows green arrows that point down. The Show field under the preview changes the arrows to numbers or to both. In a narrow window the two cards stack. Each tab shows its UXML and C# in CodeBlocks.
AbilityBarDemo.unity AbilityBarDemoController The ability bar of a game in two tabs. The Preview card shows the bar of the selected tab and a status line. Hotbar: a Hotbar with three pages (skills with cooldowns, potions with charges, auras that toggle), with fields for the skill cooldown, the global cooldown, the mana and the lock. Rebind: a bar on four Input System actions, with an InputSettingsPanel in the tab; a new key shows on the bar at once.
QuickSelectDemo.unity QuickSelectDemoController The d-pad quick bar of a console game from a QuickSelect, in two tabs; see QuickSelect. Items: weapons on Up, potions on Down, the health potion again on Right and a shield on Left. A tap uses the default item, a hold of Down picks the other potion and a hold of Right throws the potion. Fields set the hold time and the hold of Right. Wheel: four skills on the cross and two more on the wheel. View or Tab opens the wheel and slows the game, and a clock shows the game time. Show me walks through both tabs.
InventoryGridDemo.unity InventoryGridDemoController InventoryGrid in four tabs; see InventoryGrid. The ItemSlotDemo scene shows one ItemSlot on its own. The Preview card shows the grids of the selected tab, with the buttons and the status of the tab under the stage. Bag: stacks on a ListInventoryModel that merge and split (Shift drag, right click), a sort button, Add loot, potions that share a cooldown after a double click, tooltips, and a toggle that locks the last row. Equipment: four worn slots and a pack, two grids on one model with a rule for each worn slot, durability bars that Take a hit wears and Repair everything mends, and a HoverCard with an ItemCompare against the worn piece. Backpack: a shaped grid where a staff takes three cells and a shield four; the cells show where a dragged item fits, and R, the right mouse button or the right stick turns it. Stash: a virtual grid of 2000 slots with elements only for the slots in view; a double click or Enter takes an item to the bag. Each tab shows its UXML and its C# in CodeBlocks.
ItemSlotDemo.unity ItemSlotDemoController One ItemSlot in five tabs; see ItemSlot. Slot: a large slot with only an Icon. Fields set Count, MaxStack, Rarity, Durability, Locked and ShowSeconds, and run StartCooldown and ClearCooldown. The UXML in the CodeBlock follows them. States: a slot for each state, with the class that it adds: the five rarities, --worn, --locked, --empty with an EmptyIcon, and --cooling on a cooldown that loops. There are fields for the Epic durability, Lock them all and Cool them all down. Belt: six slots of potions, bombs and a scroll. Q and E, or LB and RB, pick a slot, and F, the West button or a click uses it. The two potions share one cooldown, the last of a stack leaves its EmptyIcon, and a PromptBar names the keys. Drag: a bag, and Weapon and Off hand slots that take one kind of item each. Each slot has a DragSource, a DropTarget and a ToolTip. A swap must fit both ways, and a refused drop names the slot that refuses. Enter or South picks an item up and puts it down through DropTarget.Drop, and Escape puts it back. Looks: Plain, Round, Square and Glass, a size, a Mythic rarity of the game's own, and the --tb-item-slot-sweep-color and --tb-item-slot-empty-color variables. Each tab shows its code in CodeBlocks.
MaskImageDemo.unity MaskImageDemoController Four MaskImage uses, one per tab, with a status label. Shapes: a round portrait with no setup (a Circle mask and a picture) and a row with each mask. The tab sets the picture (a wide city shows the scale modes), the ScaleMode, the Tint, the Mask (None, Circle, RoundedSquare, Hexagon, Diamond or Texture), the CornerRadius and the Softness. Cooldown: a gray copy of a skill icon under the icon in color, which a wipe cuts. Cast starts the cooldown, and the Threshold follows the share of the cooldown that has passed, so the color comes back as the skill cools. The tab sets the skill, the cooldown, Cast again when ready, the wipe (RadialWipe, LinearWipe or RadialOut), Invert, the threshold and the softness. Dissolve: a level picture that dissolves into the frame behind it through a mask texture, as in a screen transition. The tab picks the MaskTexture (noise, gradient or diamonds), the MaskChannel (alpha or luminance) and the softness, and Dissolve and Restore run the threshold. Locked: a skill tree whose locked skills are gray (Saturation 0) and dim (a class sets --tb-mask-tint). A click on a locked skill learns it, and its colors come back. The tab sets the saturation and the dim, and Lock again locks the skills. Shapes, Cooldown and Dissolve show the UXML and C# of their use; Locked shows the USS and C#.
AbilitySlotDemo.unity AbilitySlotDemoController One AbilitySlot on its own in four uses, one per tab. A status label shows Activated, CooldownFinished and why a press is refused. The key of the tab (Q, E, R or F, or X on a gamepad), a click, a submit or the button of the tab presses the slot. Skill: a slot with an icon and a key, and no other setup. A press calls StartCooldown, the sweep and the seconds count down, and the slot flashes when it is ready. A press while it cools is refused with a nudge. The tab sets the skill, the cooldown and ShowSeconds. It pauses the game (Time.timeScale 0) to show UnscaledTime, loads a save with SetCooldown at half the cooldown, and clears it with ClearCooldown. Potion: five health potions. A drink uses a charge and starts a short cooldown. The last drink leaves the EmptyIcon, a dark flask, and Usable stays off until a refill. The tab sets Charges, MaxCharges and the cooldown of a drink. Aura: a press turns Active on and off. Without the mana, Usable is false, the icon turns gray and the aura ends. The tab sets the active state and the mana. Looks: the Shape of the icon, the size of the slot (the key and the seconds grow with it), a --tb-ability-sweep-color from a class (dark, violet, frost or blood) and the Key glyph (keyboard-f, xbox-x, F or none). Skill, Potion and Aura show the UXML and C# of their use; Looks shows the UXML and USS.
WorldHudDemo.unity WorldHudDemoController A WorldMarkerLayer over a 3D arena that a camera renders into the window, in one tab. A player walks a loop past three raiders, an ally, two items and a far shrine, each with a HudTarget; Walk and Speed run the loop, and a status label names the last MarkerShown or MarkerHidden. Markers: a marker over each target, brackets around it and an arrow at the edge for a target off the view, with no more code; the tab sets ShowLabel, ShowDistance, the TargetMark and the FadeStart, how far the raiders show (MaxDistance), and whether the far shrine keeps an arrow at the edge (ClampToEdge). The tab shows the UXML and C# of the layer.
CompassBarDemo.unity CompassBarDemoController A CompassBar at the top of a 3D arena that a camera renders into the window, with five tabs. A player walks a loop past three raiders, an ally, two items and a far shrine, each with a HudTarget; Walk and Speed run the loop, the Preview card description says what each tab shows, and a status label names each event. Heading: the defaults, which follow the heading of the Player; the tab sets the FieldOfView and the TickStep of the notches. Targets: each target at its bearing, in its color; the tab sets ShowDistance and the DistanceFormat, puts the raiders, Mira or the items on the compass and takes them off (the HudShowOn.Compass flag of ShowOn), sets how far the raiders show (MaxDistance), and sets whether a target behind the player waits at the edge of the bar (ClampToEdge). Labels: four sets of Labels (8 directions, 4 directions, 16 points and degrees) and a field for labels of your own, with commas between them. Waypoints: a Minimap on the view, where a click sets a waypoint that the compass shows too (PinAdded); Route to the shrine calls SetPath, and the compass marks the next corner of the route (ShowPathMark); the tab clears the route and the waypoints and sets the most waypoints. Looks: a class gives the compass a look (Theme, Light or Gold) with --tb-compass-notch-color, --tb-compass-icon-size and --tb-compass-path-color, and a Width slider shows the labels and the icons spread over the bar. Heading, Targets, Labels and Waypoints show the UXML and C# of their use; Looks shows the UXML, USS and C#.
MinimapDemo.unity MinimapDemoController Four Minimap uses over a 3D arena that a camera renders into the window, one per tab, and a Looks tab. A player walks a loop past three raiders, an ally, two items and a far shrine, each with a HudTarget; Walk and Speed run the loop, and a status label names each event, such as the world point of a click (Clicked). Corner map: a minimap with no setup that follows the Player and makes its own top-down camera; the tab sets the Range, the Zoom, the Rotation (NorthUp or PlayerUp), the Shape and the RefreshRate, and its code shows a painted MapTexture with its WorldBounds. Fog of war: a map with FogOfWar that opens where the player walks; the tab sets the FogMode (Explored or Visible), the RevealRadius, the FogSoftness and HideIconsInFog, makes Mira open the fog too (RevealsFog), and calls RevealArea at the shrine, RevealAll, ClearFog, and SaveFog and LoadFog for a save game. Waypoints: a click on the map sets a waypoint and a click on a waypoint removes it (AllowPins, MaxPins, PinAdded, PinRemoved); Route to the shrine calls SetPath, which ShowPath draws; the tab clears the route (ClearPath) and the waypoints (ClearPins). World map: a big square map with FreePan and ZoomWithWheel that a drag, the arrow keys or the wheel move, and that shows the fog of the fog map (FogSource); the tab sets its range and calls CenterOn with the player or the shrine, and its code frees the fog texture with ReleaseFog. Looks: a class gives the fog map a look (Theme, Gold or Night) with --tb-minimap-fog-color, --tb-minimap-player-color and --tb-minimap-icon-size, and a Size slider shows that the range stays the meters to the rim. Corner map, Fog of war, Waypoints and World map show the UXML and C# of their use; Looks shows the UXML, USS and C#.
FloatingTextLayerDemo.unity FloatingTextLayerDemoController A FloatingTextLayer over a 3D arena that a camera renders into the window, with four tabs. A player walks a loop past three raiders; Walk and Speed run the loop, the layer projects with the arena camera into the view (Camera and Viewport), and a status label names the last text. Combat: the player fights the nearest raider, so damage numbers, critical hits and a heal on every fifth hit rise with Show(Transform, text, kind); quick hits on one raider add up into one number within the StackTime. The tab sets the stack time, Hit, Critical, Heal and Stun show a text of each kind, and Fight starts and stops the fight. Pickups: the text of a field, such as +50 gold, with a kind (FloatingTextKind.Custom by default, which the demo style sheet colors gold), at a point ahead with Show(Vector3, text, kind) or over the player as they walk. Motion: the tab sets the Rise, the Spread, the Duration and MaxActive, and A burst of 12 texts shows that a text past the most reuses the oldest one. Looks: a class gives the texts a look (Theme, Large or Arcade) through the class of each kind (tb-floating-text--critical, KindClass), and Show each kind shows one text of each kind in a row. Combat and Motion show the UXML and C# of their use, Pickups shows the C# and USS, and Looks shows the UXML, USS and C#.
HudBarsDemo.unity HudBarsDemoController StatBar on a dark stage: a player frame with health, stamina and mana bars (the mana in five pips) and a vertical experience bar. Hit and Heal change the health; a hit leaves a trail that drains, and a heal shows a preview. StatBar: the segments, the trail delay and speed, the low threshold, the text and the direction, with the UXML and the C# in CodeBlock controls. ResourceCounter, StatusEffectBar, ObjectiveTracker and UnitFrame have scenes of their own. On a gamepad, hold A on Heal to see the preview and let go to heal.
UnitFrameDemo.unity UnitFrameDemoController The UnitFrame in five game uses, each with its UXML and C# in CodeBlock controls. Frame: a player frame with only a name, a level and a portrait. It has Hit for 15, Heal 20, Cast for 25 mana, Add a buff and Add Frost, and fields for the name, the level, the portrait shape, the parts to show, Compact and Mirrored. Target: the player, Borin Stone, whose pixel face blinks, breathes and winces red on a hit (portrait-animation), across from a mirrored Cave Troll that casts Stone smash on a cast bar of its own. Interrupt stops the cast, and Hit, Kill and Revive change the troll. The fields set the cast seconds and Targeted. Party: four compact, interactive frames. A click or Submit selects a member for the focus frame, and Fire breath, Healing rain and Revive change the party. The fields set Show portraits and Interactive. Nameplates: compact frames with no portrait over three enemies, with Hit the target, Next target, Fireball and Respawn, a width and Show level. Looks: a class on a parent gives its frames a look of their own (ember-frames, glass-frames). Each tab has a key (Q, E, R, F, H) and X on a gamepad.
ObjectiveTrackerDemo.unity ObjectiveTrackerDemoController The ObjectiveTracker in five game uses. Each has a tracker in the corner of a game screen and the UXML and C# in CodeBlock controls. Quest: a tracker with no setup and the quest "Hold the outpost": a count of raiders, a chest, an optional scout, and a Lose the chest button that fails the quest. Restart clears the tracker and adds the quest again. Optional: a crypt whose optional relic and runes never hold back or fail the quest, with Show optional. Timed: an escape from a mine with a clock that the game writes into the exit objective each second. The clock turns red in the last ten seconds, and at 0 the exit fails. Seconds sets the clock. Quest log: village quests with more quests than room, with Max quests, Hide completed, Complete hold, Add a quest, Remove the first and Advance the first. Looks: a class on a parent sets the three color variables and the box (ember-quests, frost-quests), and Animated turns the effects off. Each tab has a key (Q, E, R, F, H) and X on a gamepad.
StatusEffectBarDemo.unity StatusEffectBarDemoController The StatusEffectBar in five game uses. Each has a hero with a bar of their own, and the UXML and C# in CodeBlock controls. Effects: a bar with no setup, with Apply, Remove Frost and Clear. Buffs and debuffs count down with a sweep, and the aura has no end. The fields are Show time, Sweep style, Pause the game and Unscaled time; a pause stops the bars that use the scaled time. Stacks: each Burn adds a stack up to Most stacks, with or without Refresh the time. Shield refreshes, and Cleanse takes the debuffs off. Tooltips: the six effects with their tooltips, and an effect of your own from Title, Tooltip, Icon, Seconds and Debuff. Sorts: effects that came at different times, in the order of Sort, with Max icons (a +N mark) and Icon size. Looks: a class on the bar sets the colors of the buff border, the debuff border and the sweep (frost-effects, gold-effects). Each tab has a key (Q, E, R, F, G) and X on a gamepad.
ResourceCounterDemo.unity ResourceCounterDemoController The ResourceCounter in six game uses, each with its UXML and C# in CodeBlock controls. Gold: a purse with no setup. Earn 25, Spend 40 and Load a save show three changes: a gain waits, falls in and rolls up, a loss rolls down at once, and a load shows at once. The fields set Animate, Roll seconds, Flash seconds, Show delta, Delta wait, Delta side and Higher is better. Coins: Collect sends coins from a treasure chest or a bounty to the purse in a top bar, as sparks or discs. Shop: three prices that are counters too, and turn red while the purse cannot pay them. Buy takes the price, and Sell loot adds 150. Storage: wood and stone with a capacity and a rate, and food that runs down. The game moves the values, and Harvest 30 wood, Build a hut, Hunt and Bigger storage change them. Formats: one amount in five formats, one of them your own. Looks: a gem pouch with a bigger icon and amount (big-gems) or colors of its own (neon-gems). Each tab has a key (Q, E, R, F, G, H) and X on a gamepad.
RollingDigitsDemo.unity RollingDigitsDemoController RollingDigits in six uses, one per tab, with the use of the tab in a Preview card and its settings, UXML and C# beside it. Flight: the pitch, the yaw, the roll and the speed of a flight instrument in Continuous mode; W and S, A and D, Q and E and R and F fly (the sticks of a gamepad too), and the autopilot flies by itself; the tab sets the tilt speed and Animate. Score: an eight-digit counter in Animated mode with buttons that add points; the tab sets Direction, Duration, Stagger and Digits. Odometer: letters on the drums (Text and Characters), where the row ends with a unit; Drive adds distance, and the field takes any text. Slot reel: Spin sets a random text, the drums stop one after the other from the left, and a Badge shows Settled. Code lock: four drums that take the focus; left and right pick a drum, up and down turn it, and the d-pad can leave the lock at its ends. A Card, Badge, Separator and CodeBlock controls fill the window. The Driller depth gauge is a RollingDigits too.
SaveIndicatorDemo.unity SaveIndicatorDemoController The SaveIndicator in four game uses, each with its UXML and C# or USS in CodeBlock controls. Checkpoint: Run to the next checkpoint walks the hero, an AnimatedImage of a knight sheet, to a flag, and the flag saves the game with Begin and Complete; Quick save saves at once. The fields set Motion, Show text and the time of the save. Settings: each change of an option saves at once, so the indicator shows for its min show time, and the check stays (saved-time="0"). The fields set Min show time, Saved time and Fade time. Cloud: Upload the save runs a task with Track; with Offline on the task fails, the error mark and Retry show, and Retry runs the upload again. Looks: spin, pulse, a picture, a coin sprite sheet (icon-animation), a check that stays and a failure, in the Theme, Game or Minimal look. A chime plays when a save is done and a buzz when it fails.
DialogueDemo.unity DialogueDemoController A DialogueBox at a night camp, where Hesta stands behind a stall by a campfire. Each line shows the face of its mood, on the portrait and on Mira. The buttons Say, Ask, Timed choice, Play conversation, History and Clear drive it: Ask has a locked choice ("Needs 5 Strength"), Timed choice runs a bar out into the second choice or into silence, and Play conversation plays SampleDialogue through IDialogueSource. The Box tab sets the typing speed, the portrait, the History button and the advance glyph; the Bubble tab switches to a speech bubble that points at the speaker; the Timed choice tab sets the seconds; the Source tab shows an IDialogueSource over Ink. Each tab shows the UXML and C#.
CombatHudDemo.unity CombatHudDemoController Crosshair in one tab; see Crosshair and hits. Crosshair: a reticle on a dark game backdrop with Fire, Hit, Kill and Headshot buttons, and a field for each setting: the shape flags, size, thickness, gap, max gap, outline, recover speed, state, interact text and target kind. The tab shows the UXML and C# of the control.
PromptsDemo.unity PromptsDemoController InteractionPrompt and GamepadGlyph, with glyphs that follow the device that the player used last; see InteractionPrompt. The PromptBarDemo scene shows the bar of hints. Preview: a door with an InteractionPrompt. Hold F, hold the West button of a gamepad, or press the prompt: the door opens, and the verb changes to Close. The Glyphs dropdown fixes the device (Auto, Keyboard, Xbox, PlayStation, Switch) with LastInputDevice.AutoDetect and Set, and every glyph follows. InteractionPrompt: the verb, the object, the hold seconds, the drain rate, and the key and button of the prompt. Glyphs: a South glyph that follows the last device next to the glyph of each family. Each tab shows the UXML and the C# that make it.
PromptBarDemo.unity PromptBarDemoController One PromptBar in five tabs; see PromptBar. The glyphs follow the device that the player used last. The Glyphs dropdown under the preview fixes the device (Auto, Keyboard, Xbox, PlayStation, Switch) with LastInputDevice.AutoDetect and Set. Defaults: a pause menu with a bar of no setup, which shows Select and Back. The Hints field sets Hints to null, to an empty list or to hints of its own. Screens: an Inventory and a Shop, whose items are clickable ListItem rows. The bar shows the hints of the screen that has the focus (PromptHint scopes). The Shop has NavigableTabView tabs with two badges that Q and E, or LT and RT, change. Escape or the East button leaves a screen. Fields turn FollowFocus off and move the focus. Can act: a Gold field. A ware that costs more than the gold gets hints with no Buy through PromptBar.SetHints, and a buy spends the gold. Glyphs: the key and the button of the Inspect hint (KeyboardGlyph, Button). A hint with no key hides while the keyboard is in use. Looks: Strip, Pill, Console and Plain, and the brand colors of the face buttons. Each tab shows its UXML and its C# in CodeBlocks.
InteractionLayerDemo.unity InteractionLayerDemoController, InteractionYard An InteractionLayer over a small 3D yard that a camera renders into the window, in four tabs; see InteractionLayer and Interactable. A door (hold 0.8 seconds), a chest (a tap), a lever (its own key F and button West), Mira (Talk) and four items on a table (Take) each have an Interactable. Walk with WASD, the arrows or a stick, or click Start, Door, Chest, Lever, Mira or Table to walk there. Each object near the player shows a hint, and the object that the player can use gets the prompt; E, the south button or a click on the prompt uses it. Yard: the notice range, the use range, the hints and the hint seconds. Hold and tap: the hold of the door, the own input of the lever and the label side. Focus: the three focus modes, with Next (Tab or RB at the table), Focus Mira, Clear and Put the items back. Looks: the dot, a ring from the USS of the example, the icon of each object and a hint template with the icon and the name (InteractionHint.uxml in Resources/UIToolboxSamples), with Pulse and Animate. Each tab shows the UXML and the C# that make it.
DamageIndicatorDemo.unity DamageIndicatorDemoController Four DamageIndicator uses, one per tab, over the player seen from above in a 3D view that a camera renders into the window. Three red spots stand around the player. A Turn slider turns the player while the wedges keep pointing at their spots, Fall damage calls Flash, Clear clears, and a status label names each hit. Shooter: the defaults. A click on a spot calls Hit with its transform. The tab sets the Radius, WedgeAngle, Thickness and Duration of the wedges, and the Vignette, VignetteStrength and VignetteWidth. Many hits: a Minigun burst whose hits merge into one stronger wedge within the MergeAngle, a Squad with a wedge for each enemy, and an Ambush from all sides that fills MaxWedges, so a new hit replaces the oldest. The tab sets the merge angle and the max wedges. Screen angle: HitFromAngle, for a hit with no place in the world, such as an attack in a 2D game or a trap (0 is up, 90 is right). The tab sets the angle and the strength, and Arrow trap and Grenade hit from the left and from behind. Damage types: a class for each type (Physical, Poison, Frost, Fire) sets --tb-damage-indicator-color and --tb-damage-indicator-vignette-color. Hit hits from spot B with the type, and Tick, a damage over time tick, flashes the edges only. Shooter, Many hits and Screen angle show the UXML and C# of their use; Damage types shows the USS and C#.
VideoDemo.unity VideoDemoController Video with the VideoView, in four tabs, with the view of the selected tab in a Preview card, from the sample clip VideoSample.mp4 that the clip attribute of each view sets in the UXML. The clip is 30 seconds of the short film "Big Buck Bunny" (Blender Foundation, CC BY 3.0, see Third Party Notices.md). Player: the built-in bar (play and pause, the seek slider with the times, mute and volume, loop, the speed and full screen) and a log of the Prepared, Started, Paused and Finished events. Custom bar: show-controls="false", big round buttons with a MediaIcon that call TogglePlay and Seek, a sound button that opens a pill in the theme colors in an AnchoredPopup, which grows up from the button (a waveform, a vertical Slider with its fill as the Volume track and a music note in the fill, and a mute button in the place of the sound button that shows a crossed speaker and dims the fill while Muted; a drag, the wheel or Up and Down set the level, and Escape or a click outside closes it), and a ProgressRing with the time from TimeChanged. Cutscene: no bar, scale-mode="Fill", a Subtitles control that plays the SRT cues CutsceneSubtitles.txt against the VideoView (the tab has a switch for the speaker, a field for the lines and a slider for the text scale), and an AutoClickButton to hold for one second to skip (the pointer or the S key). In a window: a VideoView that fills an MDI window; the view releases its player and its texture when the window closes and makes them again when it opens. Another tab pauses the videos. The bar of each use is under the preview, and each tab shows its UXML and C# in CodeBlock controls. On a gamepad, hold A on the focused Skip button for one second to skip the cutscene.
MediaIconDemo.unity MediaIconDemoController The MediaIcon in four uses. Kinds: a tile for each MediaIconKind, with a size slider and an ink color; the selected tile shows its UXML, USS and C# (new MediaIcon(kind)). Player: a replay that pans across the arena, with a bar whose buttons swap Kind (play and pause, volume and muted, maximize and restore), a seek slider, a ToggleButton for the loop, a big play button and an icon size; full size hides the tabs. Buttons: a pause menu and a high score name entry over the game, whose icons take the hover and focus color of their buttons (accent, gold or danger), with a toggle that hides the menu text; the round ToggleButtons call MarkDirtyRepaint on their icons when pressed. Looks: the same three icons in four looks (theme, gold coins, neon, and game art as a USS background-image) with a size slider.
WaveformBarDemo.unity WaveformBarDemoController The WaveformBar in four tabs, with the view of the selected tab in a Preview card and music loops that SampleSongs makes in code with SampleTones (the project has no audio files). Sound test: three songs in a list of ListItems, a spinning disc that pulses with the beat, the part that plays in a Badge, and a bar that follows an AudioSource with a marker for each part of the song; a click or a drag seeks, Left and Right step by the key step, Home and End go to the ends, and Page Up and Page Down jump between markers. Styles: the song in three bars (large, medium and slim) with fields for the style (Bars or Line), the bar width and gap, Normalize, the hover time and colors of your own from two ColorPickers. Radio log: four crew lines of babble made in code, each with a UserAvatar with a dot until the line plays, the line, and a bar in the Line style; a click on a bar plays the line from there, and the next line can play when one ends. Video: a VideoView with waveform-clip set to a score made in code, which plays in time with the picture. Each tab shows its UXML and C# in CodeBlock controls.
AudioVisualizerDemo.unity AudioVisualizerDemoController The AudioVisualizer in three tabs, with the view of the selected tab in a Preview card and songs that SampleSongs makes in code. Beat tap: a rhythm game; a Circle visualizer of 64 bars shows the song, a ring closes on each beat, the lights flash on the Beat event, and a tap (the pad, Space or the south button of a gamepad) scores Perfect or Good with a combo in a Badge; fields pick the song, the effect and the beat threshold. Effects: Bars, Line, Circle and Rings of the same AudioSource side by side, with fields for the bar count, the smoothing, the peak hold, the gain, the spin, the gradient and colors of your own from two ColorPickers. Mixer: the boss song in three parts, each on its own AudioSource started with PlayScheduled on one tick, each with a visualizer, a mute and a volume, and a master visualizer with no source that shows all the sound of the AudioListener. Each tab shows its code in CodeBlock controls.
CreditsDemo.unity CreditsDemoController The Credits roll of a markup file (CreditsDemo.txt in Resources/UIToolboxSamples) in a Preview card. Its last section, Licenses, lists the third-party content of Third Party Notices.md with the author, the license and the credit line of each item. The buttons Play, Pause, Restart and Skip under the preview call the methods of the same names, and a label shows the state. Fields beside the preview set the speed, the fast forward factor, hold last, skippable and the end action, and a text field holds the markup and rebuilds the roll when it changes.
MarkdownDemo.unity MarkdownDemoController A MarkdownView in a ScrollView, with three samples: a help screen (a table with aligned columns, a tip and a warning as Alert, a task list, a rule, links to headings), patch notes and a codex (a picture from ImageLoader, two headings with the same text). A multiline field edits the Markdown (a long line wraps, and a scroll bar shows when the text is taller than the field), and the view builds it again at each change. A long text scrolls in the ScrollView of the preview. Toggles set Selectable and HandleLinks, and a readout shows the number of blocks and the last link of LinkClicked.
GlassDemo.unity GlassDemoController GlassPanel in two tabs, with the stage of the selected tab in a Preview card. Tints: a Light, a Dark and an Accent panel over round shapes that move, with one slider for the Blur of all three, and the UXML, C# and USS of a panel in CodeBlocks. Pause menu: a game screen; Pause lays a dark glass cover over it with a menu of light glass, so the game stays in sight, blurred.
GameSkins.unity GameSkinsController The windows of a casual game in five skins: wood, bamboo, royal, candy and toon. The UXML and the code are the same for all skins. The picker puts one class on the root (gs-wood, gs-candy), and the USS file of that skin in GameSkins/Skins/ gives the parts their images and colors. The art is 9-sliced (-unity-slice-*), so one small image fits a panel, a button or a bar of any size. The windows use a window template (Resources/UIToolboxSamples/GameSkinWindow.uxml) with the title on a banner and a round close button. Each window has a drop shadow (filter: drop-shadow()). The skins restyle Button, Slider, ProgressBar, Switch, Rating, Pagination, GridPanel and AnimatedLabel through the --tb-color-* variables and USS. A small loop runs the windows: Collect adds the coins of a level, with a ParticleLayer burst to the coin bar, and the shop spends them.
ParticlesDemo.unity ParticlesDemoController ParticleLayer in three tabs, with the stage of the selected tab in a Preview card. Rewards: a click opens a chest, an AnimatedImage that plays its open clip once (PlayOnce); at its last frame (Finished) coins and gems fly from it to their counters (ParticleSettings.Target), and each counter, a ResourceCounter with a spinning coin or a sparkling gem (IconAnimation) and an icon, rolls to its new amount as they arrive (Arrived), with a coin or gem sound for each particle (at most one every 45 ms). Bursts: a click on the stage sends a burst of a preset (confetti, sparkles, an explosion, dust); sliders in the tab change the count, the speed, the gravity and the TimeScale, and a CodeBlock shows the settings. Emitters: a torch with a flickering flame (an AnimatedImage) and fire and smoke from an element (Emit, ParticleEmitter.Source), and a trail at the pointer. On a gamepad, A on the focused Bursts stage sends a burst, and focusing the Emitters stage sweeps the trail in a circle.
ParallaxDemo.unity ParallaxDemoController A ParallaxView of the platformer sheets (meadow, dusk and night) in three tabs; see ParallaxView. Drivers: the pointer, an auto scroll, a camera slider (Offset) or the right stick (FollowStick), with fields for the range, the ease, the sway, the pixel snap and reduce motion. Layers: a toggle and a depth slider for each layer, a layer of signs in front that wraps (WrapWidth), and a button that spreads the depths evenly. Code: the UXML and the C#. Show me walks through the fields.
TabsDemo.unity TabsDemoController The two kinds of tabs. Four chat windows are window tabs of one group (GroupAsTabs). A message to a tab that the user does not look at makes the tab flash and shows a count (RequestAttention, TabBadge); the selection of the tab stops the flash. The System alert gives its tab a class with a red flash (TabClass, TabBadgeTone), and the System tab is pinned. The Tabs window shows NavigableTabView as the sections of a settings page with a badge and a flash (SetBadge, SetAttention), as a vertical list, and as closeable documents that the user can move, with a mark on a note with changes. The Tabs window has a Preview card with the view of the selected tab and the chat tab group at its right; each tab has its buttons and its UXML and C# in CodeBlock controls; the code follows the last message, the Pin toggle, the download, the selected page and the notes.
TimelineDemo.unity TimelineDemoController A Timeline in three tabs, with the timeline of the selected tab in a Preview card. Crew schedule: the week of the crew of an inn. One unit of time is one hour: tick-steps keeps the ruler on clock times, major-step marks each midnight, and two formatters make the day and clock texts. Each person is a track, and each shift is an item with the color of its task. A drag moves a shift, also to another person, and a drag on an edge changes its length; the hours of each person follow in the tab, with a warning for more than 48 hours or two shifts at the same time. The clock runs the playhead through the week. Crafting queue: the tracks and the jobs come from the UXML; the playhead fills a progress bar for each station, and a new job goes to the station that is free first. Raid plan: the boss abilities are markers, and the phases and the cooldowns are spans; the status counts the abilities with no cooldown. The buttons and the status of each use are under the preview; each tab has its fields and its UXML and C# in CodeBlock controls, and the code follows the values of the fields.
ConsoleDemo.unity ConsoleDemoController A ConsoleView as a drawer over a small game. The backquote key slides it in from the top and focuses the command line. The commands are methods of the controller with a [ConsoleCommand] attribute: gold takes a number, difficulty an enum, god a bool, spawn a word from a list and a count, say the other words, and reset the console itself. Tab completes the command names and the values, Up and Down recall the history, a word in quotes is one word, and a wrong argument is an error entry. Settings: Drawer, HistorySize, Prompt and CaptureUnityLog, with a "How it is made" column with the UXML and the C# in CodeBlock controls. Commands: the attribute methods. Events: a LogView logs Executed, OpenChanged and ToggleKeyPressed. Debug console: a second ConsoleView in the layout (drawer off) with capture-unity-log. It shows the messages of Application.logMessageReceivedThreaded, also those of a worker thread. The command line, an AutoCompleteField, shows the command names as you type; Tab or Enter accepts one, Enter runs a command, and Up and Down recall the history. The line you typed comes back after the last command. Its key F1 shows the tab from anywhere in the panel, and closes the window when the tab shows. The commands are help, clear, echo, log, warn, error, timescale, theme and history (SampleDebugConsole).
NodeGraphDemo.unity NodeGraphDemoController A NodeGraph of math nodes: two Number nodes with a field feed an Add node, which with a third Number feeds a Multiply node and an Output node that shows 14. The buttons add nodes, frame all and delete the selection, and the zoom indicator in the bottom right corner of the graph zooms; a LinkFilter refuses a link that closes a loop, and each Output computes again on each change of the graph or of a field. Settings: the grid size, the grid, snap, the zoom limits, the link shape, self links and read only, with a "How it is made" column with the UXML and the C# in CodeBlock controls; the tab scrolls. Save: a "Save and load the graph" group with Save and Load buttons of the same width in one row and a status line that says what happened ("Saved 6 nodes and 5 links."). Save writes ToJson into a JSON CodeBlock in a box that scrolls, and Load makes the graph again with LoadJson and a factory that makes each node by its kind. Events: a LogView logs the events of the graph; a refused link is a warning.
QrCodeDemo.unity QrCodeDemoController A QrCode that encodes the text field as the user types. The tab sets the error-correction level, the quiet zone, the min version, a logo (which raises the level to H) and the dark and light colors, through --tb-qr-color and --tb-qr-background in classes of QrCodeDemo.uss. The readout under the code shows its version, its size in modules and its mask, or why no code shows. A "How it is made" column shows the UXML and C# in CodeBlock controls.
GridViewDemo.unity GridViewDemoController Three GridViews, one for each tab. Icon gallery: 2000 ability icons that bind only the rows in view, with a slider that scrolls to an item; the arrows, Home, End and the page keys move, and a double click or Enter uses an icon. Card collection: cards with a multiple selection by Ctrl, Shift and Ctrl+A, and Select all and Clear buttons. Achievements: a paged grid whose cells show a Skeleton until their data loads, and a button that loads them again. Sizes: the item width and height, the spacing, stretch, paged and the selection type of the gallery. Each tab has a "How it is made" column with the UXML and the C# in CodeBlock controls.
TouchButtonDemo.unity TouchButtonDemoController TouchButton in four uses of a touch game, one per tab, each over its own play field, with a status label that shows the events and the UXML and C# of each use. A mouse works like a finger. Fire: a button with no setup raises Pressed and Released and counts the shots, and each shot spreads a ring from the button and the hero. The fields set HoldToRepeat and RepeatInterval. Aim: a VirtualStick moves the hero while a DragAim button aims a spell; AimChanged moves a marker around the hero, and the spell goes off where it points when the finger lifts, or on the hero after a tap. The fields set DragAim and AimRadius. Jump: the button hosts an AbilitySlot; a jump starts its cooldown, and a press while it cools down is refused with a shake. The field sets the seconds of the cooldown. Looks: the size of the button, its art (a skill icon or a letter) and its shape (round or a rounded square), with the UXML and the USS.
VirtualStickDemo.unity VirtualStickDemoController VirtualStick in four uses of a touch game, one per tab, each over its own play field, with a status label fed by ValueChanged and the UXML and C# of each use. A mouse works like a finger. Move: a stick with no setup moves the hero: the tilt is the speed. The left stick of a gamepad moves the hero. The fields set Radius and DeadZone. Twin-stick: the left stick moves a ship and the right stick aims and fires while it is tilted; each stick follows its own finger. The fields set the Mode of each stick. Grid game: a stick with four SnapDirections and a large dead zone steps a token one cell at a time on a board, to collect the gems. The fields set the snap directions (off, 4 or 8) and the dead zone. Hide when idle: the left half of the field is the area of a stick that shows only while it is held (HideWhenIdle), where the thumb lands. The fields set HideWhenIdle and Mode.
KnobDemo.unity KnobDemoController Knob in two tabs. The Preview card shows the knobs of the selected tab, with the hint of the tab in its description. Knob: a synth with four knobs (cutoff, resonance, drive with a circular drag, a wave knob with four detents); the fields set the drag mode of the drive, the drag distance, the wheel and the value text, with the UXML and the C# in CodeBlock controls. Mixer: a mixer channel with a pan knob whose ring starts at the middle and a volume knob, with a slider for its detents. The XY pad has its own scene, XYPadDemo.unity.
VirtualCursorDemo.unity VirtualCursorDemoController VirtualCursor on a desktop made for the mouse, played with a gamepad. The left stick moves an arrow and the panel sees a mouse: the files of a list light up on hover, A selects a file and a held A drags it to the trash, X opens the context menu of a file, the right stick scrolls the list under the arrow and B raises Cancelled. The arrow hides when the mouse moves. Cursor: fields set Enabled, Speed, Deadzone and Acceleration, and a button calls Show, with the UXML and the C# in CodeBlock controls. Buttons: the gamepad buttons and the C# that binds the actions of a game.
XYPadDemo.unity XYPadDemoController The XYPad in five game uses, each with its UXML and C# in CodeBlock controls. Camera: a pad that moves an arena inside a screen (MinValue, MaxValue, FormatString, ShowValue). Filter: a morph pad that sets a cutoff Knob and a resonance Knob and follows them (SetValueWithoutNotify), with a grid (Snap, InvertY, ShowGrid). Stick: a pad that reads like a thumbstick, with a round dead zone that scales the rest of the range back to 0 to 1. Color: a hue and saturation picture made in code in the pad box (XYPad.PAD_CLASS) that tints a team banner, with a brightness and hue steps. Looks: four pads restyled with the --tb-xypad-* custom properties, with a grid and the value text. Tab and the arrow keys or a gamepad stick move the handle, and Reset puts each pad of the tab back to its DefaultValue.
IdleWatchDemo.unity IdleWatchDemoController An IdleWatch on the root of the screen, in two tabs. The Preview card holds a Badge (Active or Idle), a StatTile that counts down the seconds until the player is idle, a PromptBar that the style sheet fades by the tb-idle class, and a Pause Card that shows only while the player is idle. Watch: a toggle that attaches or detaches the watch, a slider for IdleSeconds and a button for ResetIdle, with the UXML and the C# in CodeBlock controls. Style: the USS that fades the bar and shows the card. Leave the mouse, the keyboard and the gamepad alone to see the screen go idle; any input brings it back.
FileBrowserDemo.unity FileBrowserDemoController A FileBrowser over the files of a game kept in a MemoryFileSystem, so it reads no disk: save slots, screenshots that show as thumbnails in the icons view, and mods. Browser: toggles for the icons view, the folder tree, thumbnails, multiple selection and an images filter; the star adds a favorite to the tree. Open and save: FileDialog.SaveAsync writes a save slot in memory and asks before it replaces one, OpenAsync loads a slot, and OpenManyAsync opens screenshots in the icons view. Folder picker: PickFolderAsync, with a toggle that keeps the browser and the picker in the Mods folder (RootFolder). The browser is in a Preview card that shows the hint of the selected tab; each tab has its fields and its UXML and C# in CodeBlock controls.
UnlockTreeDemo.unity UnlockTreeDemoController An UnlockTree in three tabs. Tech tree: a click on an available tech raises UnlockRequested and puts the tech into a research queue; each second 20 science goes to the first tech of the queue as its Progress, and at its cost the tech unlocks with Unlock. Skill tree: a vertical tree with unlock-on-click, where CanUnlock checks the skill points that are left; a skill that costs too much has a red cost. It has a node that needs one of two skills (requires-any) and a secret node that shows when its requirements are learned. Quest chain: the buttons of the game events complete the quests that are available, the guild and the thieves exclude each other (excludes), so one choice blocks the other, and Save and Load keep the ids of the done quests with GetUnlockedIds and SetUnlocked. The tree of the selected tab shows in a Preview card, with its status under it; each tab holds its buttons and its UXML and C# in CodeBlock controls, and the code follows the queue, the points and the save.
UserAvatarDemo.unity UserAvatarDemoController Four UserAvatar uses, one per tab, with a status label that names the selected avatar. A click on an avatar, or Previous and Next, selects one. Initials: a guild roster of ListItem rows with the initials of each DisplayName; the tab sets the name and the Size of the selected avatar. Pictures: a hero select of tiles with an Image for each hero; the tab sets the picture and the size of the selected hero. Online status: a friends list with a Badge dot (Dot, Corner) on each avatar, whose Tone shows Online, Away, Busy or Offline; the tab sets the status of the selected friend and shows or hides the dots. Shapes and frames: portraits in each AvatarShape and in a MaskTexture (a star, a heart and a seal), with frames in USS and a level Badge in the corner; the tab sets the shape, the mask, the frame and the level badge. Each tab shows the UXML and C# of its use.
AvatarGroupDemo.unity AvatarGroupDemoController Four AvatarGroup uses, one per tab, with a status label. Party: a party of UserAvatar children that shows each hero; the tab sets the Size of the avatars and turns their pictures (Image) on, and A hero joins and A hero leaves add and remove an avatar and call Refresh. Lobby: a match lobby that shows the first players and a "+N" count of the rest with Max, and names the hidden players in a tooltip; A player joins and A player leaves change the lobby, and the tab sets Max. Raid sign-ups: raids that show who signed up; Sign up puts your avatar first with Insert, and Leave takes it away; the tab sets Max and square avatars (Square). Looks: one group for each look in USS (a ring in the accent color, a dark banner, more overlap, no overlap, and squares with an accent count); the tab sets Max and the pictures. Each tab shows the UXML and C# of its use.
BadgeDemo.unity BadgeDemoController Four Badge uses, one per tab, with a status label. Status: a blacksmith shop with a status badge on each item, where the Star gem sparkles (an AnimatedImage); the tab sets the text, the Tone and the Outline of the New badge of the Frost blade. Counts: a game menu with a Count on Mail and Quest log and a Dot on Friends, in the Corner of each button. A click reads the mail, and a count of 0 hides the badge. The event buttons add mail and a quest and bring a friend online, and the tab sets the count, the MaxCount ("99+") and the corner. Filters: Clickable chips that filter a bag of eight items with Clicked; the selected chip is filled and shows a check Icon, and the others show an Outline; the tab sets Clickable and the check icon. Looks: rows of the tones, icons, counts (99+ and 999+), dots and corner badges; the tab sets the outline, the icon and square corners in USS. Each tab shows the UXML and C# of its use.
CardDemo.unity CardDemoController Four Card uses, one per tab, with a status label. Basic: a daily reward card in UXML with the default look. It has a Badge in the Action slot (tb-card__action), seven days and a chest as the content and Claim in the Footer (tb-card__footer). Claim opens the chest (AnimatedImage.PlayOnce), and at its last frame coins jump out of it; the coin of the purse spins (IconAnimation). The tab sets the Title and the Description, takes the action and the footer button away, and tries a flat, an accent and a compact look in USS; Next day moves the streak on. Shop items: three item cards made in code, with the rarity as a rich text Description, the price in Action, a picture, and Buy in Footer; the tab sets the gold of the player, which turns each Buy on or off, and turns on frames in the color of each rarity. Quest: a quest card with a seal in the action slot, the objectives and the rewards as badges, and Accept and Decline (Abandon after Accept) in the footer; the tab sets the seal and puts a timer Badge in front of the seal with Action.Insert. Character: a character card with a level badge, a UserAvatar and the stats, and Invite and Inspect in the footer; the tab sets the hero and the level. Each tab shows the UXML and C# of its use.
SeparatorDemo.unity SeparatorDemoController Four Separator uses in game screens, one per tab, with a Highlight toggle under the stage that marks the separators and a status label. Pause menu: plain lines between the groups of buttons; the tab sets the space, the thickness and the accent color of the lines. Settings: section titles with text and align (SeparatorAlign); the tab sets the text, the align and strong titles. Title screen: an "or" between Continue and New game, a vertical line in a row or a flat line in a column; the tab sets the line, the text and the align. Quest log: chapter lines with gems as child elements, and a Show more button in a line with align="End"; the tab sets the align, the gems and the Theme, Accent and Parchment looks. Each tab shows the UXML and C# of its use.
EmptyStateDemo.unity EmptyStateDemoController Four EmptyState uses in game screens, one per tab, with two buttons under the stage that empty and fill the panel of the tab (Drop all and Open a chest, Remove all and Add friends, Search for a dragon and Clear the search, Disconnect and Connect) and a status label. Pack: a pack whose last item the player drops; the tab sets the title, the message, the icon and an action button. Friends: a friends list that the empty state watches with for, so it shows when the last friend is removed and the focus moves to Invite a friend; Invite a friend and Find players are child buttons; the tab sets the text of the button, the primary look and the second button. Search: a shop search with no results that names the search in the title or the message, with a Clear the search button. Looks: a lobby browser that cannot reach the server, with a Retry button, in the Theme, Accent icon, Compact and Danger looks; the tab sets the look and the message. Each tab shows the UXML and C# of its use.
ListItemDemo.unity ListItemDemoController Four ListItem uses in game screens, one per tab, with a button under the stage that puts the screen of the tab back and a status label. Saves: saves with a picture of each place in Media and Load and Delete buttons as actions; the tab sets the first title and description, outline and the pictures. Mail: an inbox where a click, Enter or the submit of a gamepad raises Clicked and opens a mail, and a new mail has a dot and a bold name; the tab sets clickable, the avatars and the times. Menu: a main menu of clickable rows with an icon that Up and Down move through and wrap, for the keys and a gamepad; the tab sets the Theme, Large and Fantasy looks, the icons and the descriptions. Settings: a settings screen with a switch on each row, where a click on the row flips the switch; the tab sets outline, the descriptions and the row click. Each tab shows the UXML and C# of its use.
ElementImageDemo.unity ElementImageDemoController Four ElementImage uses in game screens, one per tab, with a button under the stage that takes the picture of the tab and a status label with the size of each picture. Trophy: a trophy card made of elements, and its picture in an Image with ElementImage.Capture(element, done); the tab sets the title, the rarity and the icon of the card, and a new picture destroys the old texture. Saves: a view of the world map with the marker of the player; each save is a ListItem with a picture of the view in Media and a Delete button that destroys the texture, and the fourth save drops the oldest one; the tab walks the player and shows the marker. Photo: a photo mode that takes the inside of a frame over an arena with ElementImage.Capture(panel, worldRect, done), and hides the HUD for the frame of the capture; the tab sets the place and the size of the frame and the HUD, and the gallery keeps the last three photos. Share: a result card saved as a PNG file with ElementImage.SavePng(element, path, done); the tab sets the player, the result and the stats. Each tab shows the UXML and C# of its use.
RangeSliderDemo.unity RangeSliderDemoController Three RangeSlider uses, one per tab, with a Full range button and a status label fed by the ChangeEvent<Vector2> of the slider (the low value in x, the high value in y). Spawn distance: a slider with no settings, from 0 to 100, sets two rings around the player on a radar, and the enemies spawn between them; the tab sets LowLimit, HighLimit, Step, MinRange, WholeNumbers, ShowValues and FormatString, and Spawn a wave places the enemies again. Shop prices: a price range from 0 to 500 gold in steps of 10, with its start range from C#, fades the wares (each a ListItem) that it leaves out; the tab sets the step, the values and the format string, and Narrow the price sets the value to 120 to 240. Match levels: a level range of whole numbers at least 5 apart (MinRange) picks the players of a lobby who join the match; the tab sets the min range, the whole numbers and the values, and Around my level (30) sets 25 to 35. Each tab shows the UXML and C# of its use.
TagFieldDemo.unity TagFieldDemoController Three TagField uses, one per tab, with a Clear button and a status label fed by the ChangeEvent<IReadOnlyList<string>> of the field. Item filter: a field with no settings filters a bag, where an item shows when each tag is in its name or its keywords; the tab sets Placeholder, MaxTags, AllowDuplicates and the keywords as Suggestions, and Blue magic sets two tags in one change through value. Skills: a field with a placeholder, max-tags 6 and suggestions in the UXML fills the skill slots of a character; Up, Down and Enter pick a suggestion, and Backspace selects and removes the last skill; the tab sets the limit and the duplicates, and Add three skills sets them in one change. Spell runes: a field with allow-duplicates and max-tags 4 takes a rune twice, with the runes of the spell book as suggestions from C#; each rune shows as an orb and costs 10 mana, and Cast the spell names the spell in the status and empties the field. Each tab shows the UXML and C# of its use.
OptionSelectorDemo.unity OptionSelectorDemoController Three OptionSelector uses, one per tab, with Previous, Next and Reset buttons (Previous, Next) and a status label fed by the ChangeEvent<int> of the selector, with its Text and index. Difficulty: a New game menu whose selector has its choices and value in the UXML; a description and the Enemy strength and Checkpoints StatBar meters follow it, and the tab sets the value, Wrap, ShowDots and Animate. Text size: SetEnum gives the selector the values of a TextSize enum, and GetEnum sizes the subtitles of a scene; the tab sets the value with an EnumField, Wrap and Animate. Resolution: a selector that does not wrap and shows no dots, whose Items disable the 4K choice until the 4K monitor toggle is on; the game window fills the part of the monitor that the resolution gives, and the tab sets the 4K monitor, Wrap and ShowDots. Each tab shows the UXML and C# of its use.
GradientFieldDemo.unity GradientFieldDemoController Three GradientField uses, one per tab, each field under its scene, with a Reset the colors button and a status label that gives the stops and the mode of each new gradient; Editing shows a drag in the scene at once. Sky over a day: the sky takes its color from the gradient at the hour with Evaluate, as the sun crosses the sky and a clock runs; the tab sets the length of a day, and a Time of day card pauses the day and sets the hour. Health bar: the fill of a health bar takes its color from the gradient at the health, and turns red as the health drops; the tab sets the health and the Mode (Blend, PerceptualBlend or Fixed), and Take a hit and Heal change the health. Rarity colors: a gradient in Fixed mode gives each tier one color (Common up to 0.2, then Uncommon, Rare, Epic and Legendary), and the roll of each item of the loot picks the color of its frame; the tab sets the mode, and Roll the loot rolls again. Each tab shows the UXML and C# of its use.
KbdDemo.unity KbdDemoController Five Kbd uses, one per tab, with Previous and Next prompts under the stage that select the tab (also with PgUp and PgDn) and a status label. Shortcut: a pause menu of seven rows that listens for KeyDownEvent and lights the row whose keys match the press (F5, Esc, Ctrl+K, Ctrl+Shift+S and more); the tab sets the Keys and the Separator of the search shortcut, and the menu matches the new keys. Controls: the controls screen of a game, where an empty Separator puts the caps side by side; the tab picks the layout of the move keys (WASD, ZQSD, ESDF or the arrow keys). Hints: four tutorial hints over the game with the caps in the sentence; the tab sets the interact key, and Next tip shows the next hint, one with or as its Separator. Combos: the move list of a fighting game; the tab switches the notation between words and numpad digits and sets the Separator of the sequences, while a throw keeps +. Looks: six looks of the caps, each from a class that styles tb-kbd__key and tb-kbd__separator; the tab sets the keys and the separator of all six. Each tab shows the UXML and C# of its use; Looks shows the USS and UXML.
InlineIconLabelDemo.unity InlineIconLabelDemoController The InlineIconLabel in four game uses. Tips: a tutorial tip and a prompt bar over the arena, with a keyboard text or a gamepad text that names buttons by place, such as {south}; a Device dropdown sets the Family (GamepadGlyph.FamilyOf in the C#) and Next tip moves on. Quest: a journal page with item icons from InlineIconLabel.RegisterIcon (a coin and a heart made in code, two potions and two skill icons), a font size, an icon size through --tb-inline-icon-label-icon-scale, and a page width. Chat: a party chat in which names in braces turn into icons, emote buttons, and the number of lines to keep. Looks: the same shop line in four looks (theme, parchment, neon, arcade) with a Text field and a Family field. Each tab shows its UXML, USS or C# in CodeBlock controls. The scene removes its icons with InlineIconLabel.UnregisterIcon when it ends.
KeyBindingFieldDemo.unity KeyBindingFieldDemoController Four KeyBindingField uses, one per tab, with Rebind (StartListening), Clear and Reset buttons for the selected field and a status label. Key: the jump key of a small game, whose value is the binding path of an InputAction (ApplyBindingOverride); the hint shows a Kbd with the DisplayText, or a GamepadGlyph from GamepadGlyph.TryGetButton; the tab sets the label, the Devices and the value. Rebind: the controls screen of a game, six actions with a key and a gamepad button each, all in one ConflictGroup; the tab turns the check off, or refuses a conflict in the value callback with HasConflict and SetValueWithoutNotify. Gamepad: six gamepad bindings (devices="Gamepad", in a pad conflict group) with a GamepadGlyph each that follows its value; the tab sets the Family of the glyphs and their GamepadGlyph.COLORED_CLASS. Looks: parchment, neon and arcade fields from classes; the tab sets the EmptyText and the PromptText. Each tab shows the UXML and C# of its use; Looks shows the USS and UXML.
EmojiPickerDemo.unity EmojiPickerDemoController Four uses of the EmojiPicker and the EmojiButton, one per tab, with Search, Next category and Random emoji buttons and a status label fed by EmojiPicked. Picker: the picker with its defaults, the picked emoji in large and the count of its Recent emoji; the tab sets the Category and the Search, which stays in step with the SearchField of the picker. Chat box: a guild chat (ChatView) over the game, whose EmojiButton has the message field as its Target, so a pick goes into the message at the caret; with Into the message off, EmojiPicked sends the emoji on its own; the tab sets the category of the picker. Reactions: the reaction chips of a post of the guild feed, clickable Badges under a UserAvatar; an EmojiButton adds your reaction, a click on a chip takes it back or adds it, and a quick row shows the Recent emoji; the tab sets how many quick reactions show and the category. Looks: the picker in the emj-parchment and emj-neon looks; the tab adds a class for big emoji and one that hides the search field. Each tab shows the UXML and C# of its use; Looks shows the USS and UXML.
ChoiceCardsDemo.unity ChoiceCardsDemoController Three ChoiceCards uses, one per tab, with a status label fed by the ChangeEvent<int> of the group and the picked callbacks of its cards. Set up: a Set up your game screen with a TextField for the display name, a segmented Mode row (ToggleButtonGroup), a Palette of four cards whose pictures are live previews (a light and a dark half in the accent of the palette) and that recolors the whole window when picked, and a compact row of avatar tiles that use the hero portraits; the tab sets Enabled, Details and the picture height. Class pick: four cards with pictures drawn by Tools/portraits/classes.mjs (Knight, Mage, Ranger, Cleric); a Card under the group shows the pick, its text and its Health, Attack and Magic; the tab sets Multiple, Allow empty and disables the Ranger. Settings: a game settings Card with Easy, Normal and Hard as text cards (tb-choice-cards--text) and four Extras where more than one card is on, each with its own PickedCallback; the tab sets the Difficulty with a DropdownField. Each tab shows the UXML and C# of its use.
ChoiceMenuDemo.unity ChoiceMenuDemoController Four ChoiceMenu uses, one per tab, with Focus first (FocusFirst) and Restart buttons and a status label fed by Chosen. Shop: the options of a shop keeper, where a potion that the gold cannot pay for has Enabled off and the discount is Locked with its reason until Charisma 5; the number keys pick a choice; the tab sets ShowNumbers, Wrap and the CancelChoice, and the gold and the charisma of the player; the shop keeper is a UserAvatar and the gold a ResourceCounter. Vote: the vote of a ship's crew for a port, with the days of sail as the Detail; StartTimer runs while the tab shows, and when the time runs out the menu picks the time-out choice, or -1 and the crew decides; the tab sets the seconds and the time-out choice. Battle: the moves of a turn-based fight, each with an icon and its MP cost, where a spell that costs more MP than the hero has is disabled and Escape runs (CancelChoice); the tab sets the MP and whether Escape runs; the HP and MP bars are StatBars. Looks: a battle menu in the theme, chm-fantasy, chm-terminal and chm-cartoon looks; the tab shows the numbers, locks Magic with a reason and starts and stops the timer of all four. Shop and Battle show the UXML and C# of their use, Vote shows the C# and USS, and Looks shows the USS and UXML.
ChoiceWheelDemo.unity ChoiceWheelDemoController Three ChoiceWheel uses, one per tab, with a status label fed by HighlightChanged, Chosen and Refused, a sound for each and sparkles in the color of the tone of a pick. Conversation: Brom the smith talks in a DialogueBox whose Wheel is set, so Ask shows the choices in the wheel over the forge, a picture from Tools/skins/forge.mjs; each choice has a tone, Haggle is Locked with its reason until Charm 4, I need a sword. leads to a question with a timer (StartTimer through Ask), Escape says Goodbye (CancelChoice), and the trust of Brom goes up with Friendly and down with Hostile; the tab sets the Charm, the timer and the numbers, and shows the C#. Approach: a wheel on its own at a gate, with the warden Aria in a TypewriterLabel and their suspicion in a StatBar; Greet lowers it, Threaten raises it, Ask about the gate is Investigate, and Sneak past has an icon and is disabled by day; at 0 the gate opens with confetti. Radio: a wheel of squad orders on the right stick (Point) with the number keys; the tab sets the number of choices, InnerRadius, ShowNumbers, Animate and a Starship or Parchment look, and shows the UXML and the USS. The Show me tour walks the three tabs.
AccordionDemo.unity AccordionDemoController Four Accordion uses, one per tab, with Open next and Close all buttons that set the value of the sections of the shown accordion and a status label fed by Opened. Help page: the defaults, questions with one answer open at a time; the tab sets Multiple, Collapsible and Animate. Quest log: a journal with collapsible="true" whose Opened event tracks the open quest; Add a quest adds a closed Foldout and then opens it, and the tab sets Collapsible. Settings: a settings screen with multiple="true", so Video and Audio stay open together; the tab sets Multiple and Animate. Bestiary: a game skin of wood headers over parchment pages in USS; the Game skin field adds and removes its class. Each tab shows the UXML and C# of its use; Bestiary shows the UXML and USS.
SplitPanelDemo.unity SplitPanelDemoController Four SplitPanel uses, one per tab, with Reset sizes (Sizes), Move -40 and Move +40 (MoveSplitter) buttons and a status label fed by SizesChanged and PaneCollapsedChanged. Codex: the defaults, a list of creatures beside the entry of the selected one; the tab sets Vertical, MinPaneSize and KeyStep. Level editor: three panes with min-pane-size="80" and grips; the Hierarchy and Inspector toggles call CollapsePane and ExpandPane and follow PaneCollapsedChanged, and Grip sets the grip class. Game and chat: a vertical panel with the game over a nested panel of chat and party; Save sizes and Restore sizes keep and set Sizes, collapsed panes too. Looks: a crafting bench with grips, thick splitters and a game skin of wood and parchment in USS, each from a toggle. Each tab shows the UXML and C# of its use; Looks shows the UXML and USS.
SidebarDemo.unity SidebarDemoController Four Sidebar uses, one per tab, with Toggle (Toggle()), Previous and Next buttons that select the item before or after the selected one, as the shoulder buttons of a gamepad do, and a status label fed by ItemSelected and CollapsedChanged. Settings: the defaults, a page of settings for each item; the tab sets Collapsed and Side. Game hub: the menu of a game hub with groups and sub-items, a Badge.Count on Mail that New mail raises, a Shop that opens with SetEnabled, Go to Ranked that sets Selected to a sub-item, and shortcut="Ctrl+B" while the hub shows. Icon rail: collapsed="true" with icons over a game; Options shows its sub-items in a flyout, and without icons the first letters show. Looks: a build menu with side="Right" over a map in a wood skin, with a filled selection and large rows in USS, each from a toggle. Each tab shows the UXML and C# of its use; Looks shows the UXML and USS.
FlipViewDemo.unity FlipViewDemoController Five FlipView uses, one per tab, with Previous (Previous()), Next (Next()) and First (GoTo(0)) buttons for the view of the tab and a status label fed by SelectionChanged. Tutorial: the defaults, four steps with Kbd key caps; the tab sets Loop, ShowArrows and ShowIndicators, and Start again on the last step calls GoTo(0). Heroes: a character select with items-per-view="3", alignment="Center" and loop="true", cards from AddPage and Choose for the selected hero; the tab sets ItemsPerView, Alignment and StepSize. Spellbook: spells on parchment with transition="Fade"; the tab sets Transition, TransitionDuration and Vertical, and Turn is a page turn made with CustomTransition. News: a news feed that turns with AutoAdvance only while the tab shows; the tab sets the seconds, and Add news calls AddPage and GoTo. Looks: a level select over a world map with step-size="Page" and four levels in view, with a wood skin, round arrows and bars for the dots in USS, each from a toggle; a click on a level plays it or says that it is locked. Each tab shows the UXML and C# of its use; Looks shows the UXML and USS.
CarouselDemo.unity CarouselDemoController A character select with a Carousel of six heroes and a Card below with the stats of the selected hero. Two tabs. Heroes: toggles for Loop and ShowStrip, a slider for VisibleItems and a Choose button (ItemChosen); a click on a hero beside the middle one, a swipe, the arrow keys, the d-pad and LB or RB step the row, and A or Enter chooses. Look: sliders for ItemScale, ItemOpacity and TransitionDuration. Each tab shows the UXML and C# of its use.
NavigableTabViewDemo.unity NavigableTabViewDemoController Five NavigableTabView uses, one per tab, with Previous tab and Next tab buttons and a status label fed by activeTabChanged, tabClosed and tabReordered. Settings: the Audio, Video, Controls and Online tabs of a settings page with the defaults; the tab sets selectedTabIndex and reorderable, and Focus the tabs gives the focus to the tabs, where Left and Right change the tab. Character: the Inventory, Skills, Map and Journal tabs of a character menu that Q and E or the shoulder buttons page through with SelectNext; the Map tab is locked with SetTabEnabled until the map is found, and the paging skips it. Mail: New letter counts the unread letters in a badge on the Mail tab with SetBadge and the chosen BadgeTone, and Guild call makes the Guild tab flash with SetAttention until it opens. Whispers: New whisper adds a Tab with closeable at the end, or opens the tab of that name; the tab sets closeable and reorderable. Looks: the Fire, Frost, Storm and Light tabs in the theme, underline or pills look, vertical with TabView.verticalUssClassName, and with icons from iconImage. Each tab shows the UXML and C# of its use.
BreadcrumbDemo.unity BreadcrumbDemoController Four Breadcrumb uses, one per tab, with Up one level and Reset buttons and a status label fed by Navigated; Escape or the East button of a gamepad also goes up one level with NavigateTo. Files: a file browser of the game folders, saves, mods and screenshots; a folder in the list calls Push, and a segment click raises Navigated and goes back to that folder; the tab sets Items and Separator, and Focus the path gives the focus to the segments. Shop: a merchant shop of potions, spells and armor; a category calls Push with an icon, SetChoices gives a segment an arrow with the categories next to it, and a pick in that menu raises ChoicePicked and switches the category; the tab turns the icons (SetIcon) and the choices on and off. Dungeon: a path of up to ten rooms, where Go deeper calls Push and Flee to town calls NavigateTo(0); MaxVisible folds the middle rooms into a "…" segment. Looks: a path to the throne room of Frost Keep with the ›, / and » separators, a chevron drawn in USS with SeparatorClass, and the pills and parchment styles. Each tab shows the UXML and C# of its use.
PaginationDemo.unity PaginationDemoController Four Pagination uses, one per tab, with First page and Last page buttons and a status label fed by PageChanged. Lore book: a book with a chapter on each of its 12 pages, set with page-count only; the tab sets PageCount and Page, Q and E or the shoulder buttons turn the page, and Focus the pages gives the focus to the buttons. Leaderboard: 250 players, ten on a page, from SetItemCount; the tab sets SiblingCount and ShowFirstLast, and Jump to my rank sets Page to the page of the rank of the player. Saves: a list of saves with ShowLabels and a page size selector from PageSizes that raises PageSizeChanged; Quick save and Delete the oldest call SetItemCount again, and a click loads a save. The saves are clickable ListItem rows, and with no save an EmptyState offers a Quick save button. Looks: a level select of nine worlds with the round, dots and gold styles and a centered pager; a click on a level shows its stars, which are a read-only Rating of 3. Each tab shows the UXML and C# of its use.
ToolBarMenuDemo.unity ToolBarMenuDemoController One ToolBarMenu as the menu bar of a level editor: File, Edit, View, Brush and Help titles with submenus over a 16 x 9 level that the brush paints, Undo and Redo buttons, and a status label fed by ActionTriggered; each tab changes the bar. Menus: the tab sets the text of the File title and its & access key, and the Text, Shortcut, Destructive and Enabled of the Clear level item; Save, Undo and Redo follow an EnabledPredicate. Keys: HandleShortcuts turns the shortcuts on and off, lists show the shortcuts and the access keys, two buttons call OpenByAccessKey and RunShortcut, and the Level name text field keeps its own keys. Checks: the Grid item is Checkable, and the zoom and brush items each share a RadioGroup under a MenuLabel heading; the fields, the keys 1 to 5 and the palette follow Checked. Overflow: the bar width slider moves the last titles into the ≡ OverflowItem, Add a title and Remove a title call AddMenu and RemoveFromHierarchy, and the tab lists OverflowMenus. Looks: the wood, neon and retro looks on the style scope of the editor, which the menus take when they open; Open the File menu calls Open on the bar. Each tab shows the UXML and C# of its use.
ScreenStackDemo.unity ScreenStackDemoController The options menu of a game as a ScreenStack: Main opens Options, and Options opens Audio, Video or Controls. A button pushes a screen by id, and B, Escape or the Back button pops it; the d-pad never does. Reduce motion, the transition, its time and the header change in the Transition tab, and Listen at the root shows BackAtRoot in the status line.
AudioSettingsPanelDemo.unity AudioSettingsPanelDemoController AudioSettingsPanel step by step, in five tabs, next to the volumes in effect (listener, pause, toolbox sounds, mixer groups) and five test tones made in code (SampleTones). Quick start: the panel with no setup reads the volumes in effect; the tab sets ShowButtons. Options: AudioOptions.Mixer with the SettingsMixer turns on the Music, Effects and Voice rows, and a subclass of AudioOptions adds an Ambience row that its Apply sets. Save and apply: ApplyAsync, Revert, Defaults and IsDirty from code, the JSON under tb.samples.audiodemo, Forget, a new panel that loads the save, and a log of PropertyValueChanged and the buttons. Keys and gamepad: Tab, Left and Right, Space, Ctrl+Z and Ctrl+Y in the grid; Escape or the East button reverts the edits (code of the demo, with a toggle). Looks: a second panel in a style scope in a Parchment and a Terminal look, with option selectors (Grid.UseSelectors) and descriptions (Grid.ShowDescription). It starts from the applied options, and the first panel takes what it applied. The demo puts the volumes, the pause, the mixer and the toolbox volume back and deletes its key when it ends.
GraphicsSettingsPanelDemo.unity GraphicsSettingsPanelDemoController GraphicsSettingsPanel step by step, in five tabs, over a small 3D arena whose camera the panel sets, next to the settings in effect (quality level, VSync, frame rate limit, field of view, display, pipeline asset). Quick start: the panel with no setup and its Camera; the tab sets ShowButtons. Options: ConfirmDuration of the question that asks to keep a display change, and a subclass of GraphicsOptions that adds a Frame counter row. Save and apply: ApplyAsync, Revert, Defaults and IsDirty from code, the JSON under tb.samples.graphicsdemo, Forget, a new panel that loads the save, and the log. Keys and gamepad: the keys of the grid, and Escape or the East button reverts the edits or answers Revert in the question. Looks: a second panel in a style scope in a Glass and a Bamboo look, with option selectors and descriptions; it shares the applied options with the first panel. The demo applies the settings it found at the start and deletes its key when it ends.
InputSettingsPanelDemo.unity InputSettingsPanelDemoController InputSettingsPanel step by step, in five tabs, over an InputActionAsset that the demo makes in code (Jump, Dash, Block, Interact, Screenshot), next to the bindings in effect and the actions that the keys perform. Quick start: the panel with no setup and Actions; the tab sets ShowButtons. Options: edits from code through FieldOf (Jump on J, Dash on Space, which moves the old key of Dash to Jump, and no Screenshot key), and a Menu map that adds a title row for each map. Save and apply: ApplyAsync, Revert, Defaults and IsDirty from code, the JSON of InputBindingOptions under tb.samples.inputdemo, Forget, a new panel that loads the save, and the log. Keys and gamepad: Tab and the D-pad move through the key fields, Enter or South waits for a key, Delete or Backspace clears it, and Escape or East reverts the edits. Looks: a second panel in a style scope in an Arcade and a Candy look, with compact rows and a Show buttons toggle. Without the Input System the demo shows a note. The demo destroys its actions and deletes its key when it ends.
ThemeSelectorDemo.unity ThemeSelectorDemoController ThemeSelector step by step, in five tabs, over a few controls in the colors of the theme, next to the theme in effect and the last ThemeChanged events. The selector themes the workspace of the demo, so the whole demo takes the theme. Quick start: the selector with no setup finds the workspace around it; the tab sets its label. In code: a SetTheme button for each of Workspace.AvailableThemes, TextSize, and a second selector made in code with Workspace set; the selectors follow each change. Settings panel: a small ThemeSettingsPanel built on SettingsPanel<ThemeOptions> with a PropertyGrid; it follows the selector, and Apply sets and saves the theme and the text size under tb.samples.themedemo, with Revert, Defaults, Forget and a new panel. Keys and gamepad: Tab, Enter or South to open the list, Up and Down, Esc or East to close, and F2, a key of the demo that steps the theme (with a toggle). Looks: a selector in a style scope in an Arcade and a Candy look, with a Show label toggle. The demo sets the dark theme and the Normal text size back and deletes its key when it ends.
StatDeltaDemo.unity StatDeltaDemoController StatDelta in game screens, one per tab, with a status label and the UXML and C# of each use. Quick start: one stat of a new sword with only from and to; the fields set From and To (SetValues), HigherIsBetter and Display, and the C# logs Delta, Arrows and IsBetter. Level up: Level up raises the stats of a hero, each with a delta; the fields set Display, Percent, DoubleAt, TripleAt and Format on all of them. Shop: hover or focus an item to compare it with the equipped sword (SetValues from FocusInEvent); less weight is better (HigherIsBetter false), and Buy equips the item for its gold. Damage preview: hover or focus a spell to preview the health of the enemy, the mana and the cooldown, where less is better; a click casts the spell, and the armor field changes the damage; the health bar of the enemy is a StatBar, so a hit leaves its trail. Looks: four looks of a loot card (Theme, Accent, Colorblind, Parchment) from USS rules on tb-stat-delta--better and tb-stat-delta--worse, with their USS.
StatTileDemo.unity StatTileDemoController A dashboard of six StatTiles in a grid, in two tabs. Dashboard: Gold earned, Players online, Win rate, Quests completed, Latency (less is better, so a fall is green) and New reviews (a tile that starts with no data and shows the "No data" pill; its toggle brings the data). A timer updates the values every second with a compact number, a change with a slanted arrow and a percent, and a sparkline, and makes no garbage. Each tile has a "…" menu with Refresh and Hide, a Badge shows Live or Paused, and an EmptyState shows when every tile is hidden (Show all tiles brings them back). The d-pad moves between the tiles, A opens the menu of a tile and B closes it. Playground: the fields set the Display and the ArrowStyle of the StatDelta, HigherIsBetter, the No data state and Clickable of the Gold earned tile. Each tab shows the UXML and C# of its use.
ToolTipDemo.unity ToolTipDemoController The workspace tooltip in game screens, one per tab, with a status that tells where and when each tooltip shows, and the UXML and C# of each use. Quick start: the plain tooltip text of the buttons of a pause menu, with no setup; the fields set Workspace.TooltipsEnabled, Workspace.TooltipDelayMs and the text of one button. Abilities: each skill of a hotbar gets a ToolTip from C# with a Header, a rich text Body, Placement and ShowDelayMs (AttachTo). Item stats: ToolTip elements in UXML on the stats of an amulet, with hide-delay so the pointer can come back to the tooltip; Upgrade changes the armor and the body of its tooltip (ToolTip.For). Settings: the options of a settings screen show their tooltips to the focus of the keys and a gamepad; the warn field sets TooltipClass to ToolTip.WARNING_CLASS on ray tracing. Looks: seven looks of the tooltips of a treasure chest: the theme, ACCENT_CLASS, SUCCESS_CLASS, WARNING_CLASS, ERROR_CLASS, and parchment and neon from USS (tooltip-class).
ContextMenuDemo.unity ContextMenuDemoController ContextMenuComponent in game screens, one per tab, with a status that tells what each menu did, and the C# of each use. M or the Y button of a gamepad opens the menu of the focused element. Quick start: a right click on a crystal shows Mine, Inspect, Upgrade and Shatter (AddItem, AttachTo, Closed); the fields add a MenuSeparator, enable Upgrade (Enabled) and make Shatter Destructive. Inventory: one menu serves each slot of a backpack (AttachTo(slot, stack)), with a heading (AddLabel), shortcuts, access keys (&), EnabledPredicate and CheckedPredicate from the stack, a Split stack submenu (AddSubmenu) and ActionTriggered. Party: the menu of each hero checks their order (AddRadioItem with CheckedPredicate), greys Heal for a hero who is not a cleric and greys Trade and Kick in combat; the fields set the leader, the combat and the order icons (Icon). Map marker: a click on a marker shows the menu beside it (ShowDropdown with the side and the alignment of the fields), with a waypoint (AddCheckableItem), Fast travel, a Marker color submenu of radio items and Discovered. Looks: five looks of the menu of a merchant (Theme, Parchment, Wood, Royal, Neon) from a class on the menu and its Haggle submenu, with their USS.
GameMenu.unity GameMenuController A main menu and a pause menu over a game. Each screen fills the panel, fades in and slides up with WindowAnimations (SampleScreen.Show and Hide). A "Companion app" card on the main menu shows a QrCode of a link. Up and Down move between the menu buttons and wrap (SampleNavigation.WrapUpDown, which the Expedition example also uses). Escape or the gamepad East button goes back one screen, and the gamepad Start button pauses and resumes. A PromptBar at the bottom shows the buttons of the screen that has the focus, in the glyphs of the device that the player used last; its hints are child elements in GameMenu.uxml, with the name of each screen as the scope. The pause sets Time.timeScale to 0, so the play time stops. Settings is a screen of the game: the title, then the settings tabs (SettingsBody.uxml) in a panel, with no window and no toolbar. The tabs have BumperSwitch, so LT and RT, or Q and E, change the tab. Graphics is a GraphicsSettingsPanel without its buttons: the footer buttons call it, and Apply changes the real graphics settings. Audio is an AudioSettingsPanel without its buttons, with the SettingsMixer mixer of the example and buttons that play a test sound through the Music, Effects and Voice groups. Controls is an InputSettingsPanel without its buttons, with five actions that the controller makes: a key field for the keyboard and one for the gamepad of each action; a key that another action has moves to that action. Interface sets the theme, the text size, the tooltips, the animations and the subtitles of the workspace; the subtitles show or hide the line of a Subtitles control on the game screen. The Interface tab edits a copy of SampleSettings, and each panel edits a copy of its options. Apply copies them to the game: the workspace, the graphics and audio options and the binding overrides of the actions. Revert and Defaults change the copy only. The footer shows "Unsaved changes" while the copy differs. Back gives the focus to the button that opened it. The screens are in a Workspace without windows, so the Theme and Text size options of the Interface tab style the whole game. Main menu asks "Back to the main menu?" with a Resume / Quit MessageBox first, and Resume has the focus (DemoNavigation.AskQuitAsync). Quit asks the same way, then simulates the exit: the game ends and the main menu shows a note. A real game calls Application.Quit there. When the demo menu opened the example, the Quit items read Back to demo menu and go there at once. The SettingsController on the same object runs the Settings screen.
Shop.unity ShopController The smithy of Brom, a talking vendor. ShopBackdrop shows the room as a pixel picture from Tools/skins/shop.mjs: shelves, a lamp whose light flickers, and dust in its light on a ParticleLayer. Brom is a UserAvatar with the pixel face brom.png, and a TypewriterLabel speech bubble greets the player, praises a buy, comments on a sale and refuses a buy that the purse cannot pay. One DataGrid shows the stock of the vendor, the other the bag of the player, and a cell renderer shows each item as a small ItemSlot and colors the name by its rarity; the item on sale has a Sale Badge and a struck-out price. A Card between the grids shows the selected item with an ItemSlot, the price and an ItemCompare against the worn gear, and sparks rise from a rare item. Select a row, set the quantity with a NumericUpDown and press Buy or Sell. A selection in one grid clears the other. The vendor sells for the item value and buys for half of it. Buy and Sell are disabled while the deal cannot happen, and the status line tells why: not enough gold, a full bag, or too few in stock. A deal of 100 gold or more asks with MessageBox.ConfirmAsync, and Cancel has the focus. The gold of the player is a ResourceCounter in the toolbar; coins fly between the purse and the card at each deal, and the gold rolls and flashes. A bought item fills the stacks in the bag first; a sold item goes to the vendor stock. SampleShop holds the rules and reuses the item and the bag of the Inventory example (SampleInventory.Add, Room and Remove).
CharacterSheet.unity CharacterSheetController A character sheet: Aria the ranger at a night camp of pixel art that CharacterBackdrop shows, with embers that rise on a ParticleLayer. The header has a level Badge and StatBar controls for the experience, the health and the mana, which show the new maximum before a change. The hero is a UserAvatar with the pixel face aria.png and an ItemSlot for each kind of worn gear. A SpiderChart shows the six stats of the hero with the worn gear. A NumericUpDown for each stat spends the free points, and a StatDelta beside it shows the change; its minimum is the base stat and its maximum the stat plus the free points, up to 20. The gear grid lists the equipment in the bag of the Inventory example, with its stat bonuses. The selected row is tried on: the chart outlines the new stats, and each axis shows "now → then" in green or red. Spend keeps the spent points and glows while points wait, Reset gives them back, and Equip wears the selected item with SampleInventory.Use. Up and Down move between the stats, and Left and Right spend and give back points (SampleNavigation.SpinnerRows). SampleCharacter holds the stats, the points and the gear bonuses.
Loading.unity LoadingController A LoadingScreen. The Travel window enters and leaves the mine, the LoadingLevel.unity scene, which loads additively and unloads with UnloadSceneAsync. LoadAsync follows the operation: the screen fades in over the panel, a ProgressRing or a progress bar shows the progress, and the tips fade in turn every TipDuration. No pointer, key or gamepad input reaches the workspace, and the screen has the focus. The screen stays at least its MinimumTime, so a fast load does not flash. The time is unscaled, so a paused game still loads. Two toggles in the Travel window show a bar instead of the ring, and make the screen wait for a key (PressAnyKey) at the end. Behind the screen a pixel art night at the mine passes by (LoadingBackdrop), a mine cart rides the bar (LoadingRunner), the tips sit on a Card with a lantern, and crystals float up: a click bursts one on a ParticleLayer and sends a shard to a ResourceCounter score. In the editor the level loads by its path; a player build must include LoadingLevel.unity.
RetroPC.unity RetroPCController, RetroPCRoom, RetroMines An old computer in a room, with the desktop of "Toolbox 95" on its monitor. Walk with WASD and look with the mouse (click to lock the mouse). Look at the computer and press E or click it to sit down; Escape stands up. The HUD is a Crosshair with the Dot shape and an InteractionLayer. The monitor is an Interactable ("Use", "PC"). While you look at the computer, the layer shows the prompt with the key E, and the crosshair is in its Interact state with the InteractText "Click: use the computer". RetroPCRoom renders the panel into a RenderTexture (PanelSettings.targetTexture) on the screen of the monitor, and SetScreenToPanelSpaceFunction sends the mouse through a MeshCollider raycast, so the desktop takes clicks only while you sit. The desktop is a Workspace with a 90s look in RetroPC.uss: desktop icons, a Start menu, a taskbar with a button for each open window (a click on the focused one minimizes it), and a clock. The programs: a Welcome window with tips, Notepad (a ToolBarMenu and a multiline TextField), My Computer (folders and text files), Mines (RetroMines, 9 x 9 with 10 mines; the first click is safe, a right click sets a flag), a Command Prompt (HELP, DIR, CD, TYPE, CLS, VER, ECHO, DATE, TIME, NOTEPAD, MINES, DISPLAY, EXIT), and Display Properties, where a ColorPicker sets the desktop color. Shut Down closes all windows; a click starts the computer again. Set BuildRoom off to show the desktop flat on the screen.
QuestBoard.unity QuestBoardController The notice board of a village, without a workspace: parchment notes pinned to a cork board in a wood frame, with the Cinzel font. The four columns (Rumors, Accepted, On the road, Turned in) are list DropTargets, as in the task board: a drag shows the line at the place of the drop. The canDrop filter holds the rules: the party carries three quests, and Turned in takes a quest only from On the road. Each note has the wax seal of its kind of quest, with a crest (an arrow, a sword, a shield or a pouch) and a color from -unity-background-image-tint-color, the danger as a read only Rating, the giver as a UserAvatar and the reward. A ParticleLayer raises a puff of dust at each drop and lets dust motes drift over the board (Emit from the board). A turned in note gets a large wax seal on a ribbon and stays still, and its reward flies to the purse as gold coins (ParticleSettings.Target); the purse counts up as each coin arrives (ParticleLayer.Arrived). Move left, Move up, Move down and Move right act on the selected note through DropTarget.Drop(data, index), so the keyboard and a gamepad work. Click a note (a press without a drag) or press Enter on a selected note to open its ticket, a Dialog styled like the board: title, kind seal and column, giver with UserAvatar, danger, reward, description, objectives (done steps are checked) and a log line. Its action button (Accept, Set out, Turn in) moves the quest through the same rules as a drop, a refusal shows in the ticket, and Close or Escape closes it. The board plays sounds through the scene WorkspaceAudio: paper when a note comes off the board, pin when it lands, error for a refused drop, confirm for the seal, and coin for each coin that reaches the purse, at most one every 45 ms.
Jigsaw.unity JigsawController A jigsaw of twelve polyomino pieces on two shaped InventoryGrids that share one ListInventoryModel: a tray of loose pieces and a board. The picture is a script-drawn landscape that the controller cuts into one texture for each piece. A piece fits wherever its shape fits and is home only in its own spot, upright; SlotBound tints the border of a home piece. The look is a mini-game: a wood table made by a script, a score bar with a Badge, a ProgressBar, a clock and a move counter, the picture on the box lid, a Card banner with a Play again button for the win, and a pause menu on Escape or Start. See Jigsaw.
Gathering.unity GatheringController The notifications of a game, without a workspace. Click a tree, a rock or a bush to gather wood, stone or food; each node has charges, and a ProgressRing shows the regrow of an empty node. Two NotificationArea elements fill the field. The pickup feed at the bottom left shows each pickup as NotificationBubble.Icon, the name and the count: stack-duplicates adds a pickup to the bubble with the same message ("Wood x5"), and queue="false" drops the oldest pickup when the feed is full. The Look field switches the feed between a panel and plain text with only the icon (one class on the area); the code blocks show the C# of a pickup and the USS of the look. The events area at the top shows "Quest complete", a lucky gold find in a rock, and "Backpack full" at 30 items, which stays (DurationMs = 0) until its Sell all action or the Sell all button of the HUD turns the items into gold. A sale sends gold coins from the backpack to the gold counter with ResourceCounter.Collect, and the counter grows as each coin lands. From the demo menu, the Demo menu button sits at the right end of the HUD.
Crypt.unity CryptController, CryptWorld, CryptHero A dungeon crawler seen from above, built from primitives. Click the floor to walk, click a skeleton to fight it, and press the right mouse button or Space for a nova. A skeleton drops gold, sometimes a health potion, and experience; each level gives two points to spend. The HUD has a health orb and a mana orb of liquid behind frosted glass (CryptOrb, a GlassPanel with particles), a hotbar of potions on the keys 1 to 6, the experience bar and the frame of the target. Character (C) is a paperdoll with the four gear slots and the stats, with a + button for each stat; Inventory (I) is the bag. The two windows use the template UIToolboxSamples/CryptWindow: an iron frame with brass corners, the title on a scroll and a round close button, with the art in Examples/Crypt/Art. They do not resize, and Crypt.uss hides the snap preview. The bag and each gear slot are an InventoryGrid on one model of the inventory of the hero, so an item drags between the bag, the gear slots and the hotbar; a double click drinks a potion or puts on a piece of gear. The worn gear sets the maximum health, the maximum mana and the damage. The item under the pointer or the focus shows a HoverCard with its description and, for gear in the bag, an ItemCompare against the worn piece. A level up shows a banner at the top middle (NotificationArea with a game style) with bursts of sparks from a ParticleLayer.
Outpost.unity OutpostController A third-person game over a small outpost, built from primitives, with every HUD control of the toolbox over it: StatBars for health (with a trail), stamina, mana and experience in pips, a UnitFrame for the target, an ObjectiveTracker with a quest, a Hotbar of four abilities, a CompassBar, a Minimap with a fog of war, WorldMarkerLayer markers, floating damage numbers, and an InteractionLayer with hints and a prompt on the chest, the scout and the beacon. Walk with WASD, sprint with Shift, use the abilities on 1 to 4, and press or hold E near an object. With no input for 3 seconds the player plays on its own.
Expedition.unity ExpeditionController, ExpeditionWorld A crew sim on a small ship, seen from above, as a full-screen HUD in its own skin. The Hull skin is one USS file (Skins/Hull.uss) under the class skin-hull; the Menu switches to the default toolbox theme. StatBar pips show the hull and the shield, a ProgressRing the crew level, two AbilitySlots the ship abilities and a ResourceCounter each resource, with the change as a delta. Each crew card has a UserAvatar, a health bar, a Badge and a HoverCard. A speed ToggleButtonGroup, an ObjectiveTracker, a NotificationArea, a Minimap and Kbd key caps complete the HUD. At 18:00 the game pauses and the event "Derelict probe" opens: the ship draws into a screen-sized RenderTexture that the root shows, a dark GlassPanel blurs the ship and the HUD behind the event, and the glass goes away with the event. The event shows a live picture of the probe, types its text with a TypewriterLabel and offers a skill check. With no input for 3 seconds the game plays on its own at 2x.
Breach.unity BreachController, BreachWorld A first-person shooter over a walled compound at dusk, built from primitives, with a full-screen HUD. The Crosshair opens while the player moves and fires, turns red over a drone, changes near an ammo crate, dims during a reload and shows hit, headshot and kill markers. An InteractionPrompt hangs over the ammo crate within reach with the glyph of the device that the player used last (E on the keyboard, the south button of a gamepad) and "Take Ammo"; a hold of half a second fills the ring around the glyph and takes the ammo and the armor, and the marker of that crate gives way to the prompt while it shows. The DamageIndicator points a wedge at each drone that hits the player and flashes the edges. StatBar pips show the armor and the magazine, a ProgressRing fills around the crosshair during a reload, and others fill in a panel under the crosshair and on the marker of a beacon while the player captures it (the progress falls back at a steady rate outside the ring), and an AbilitySlot holds the grenade with its cooldown. A Subtitles radio at the bottom center (Command speaks on each capture), a CompassBar, a round Minimap that turns with the player, WorldMarkerLayer markers, floating damage numbers, an ObjectiveTracker and a NotificationArea complete the HUD. Each round starts with a Get ready countdown (3, 2, 1, Go!); the player can look around but cannot move, fire, reload or throw until Go. Each shot kicks a carbine, flashes the muzzle and sends a tracer to the hit point, with a spark where the round lands; a drone shot is a red tracer that passes the camera. All sounds are made in code (shots, hits, reload, grenade, the capture chime and the countdown beeps). Esc opens a Card menu with an auto play Switch and a sound volume Slider. The switch starts off; with it on and no input for 5 seconds, the player plays on its own, and it waits for Go.
Reactor.unity ReactorController, ReactorLevels A node-wiring puzzle on a NodeGraph over three levels. Power, coolant and data ports have their own types and colors, a LinkFilter refuses a wire that closes a loop, and LinkRejected shows a toast that says why a wire does not fit. A splitter gives half of its power to each output, and each consumer needs its exact amount. A header names the level and holds the toasts of a NotificationArea, so they never cover a part. The side panel lists the levels with their state and time, an ObjectiveTracker holds the goals, a StatBar per consumer shows its power, a ProgressRing the core charge and a StatBar the heat. A wire with no power is dashed, a wire into a consumer with too much power is red, and the core pulses while it runs. A Card ends each level, and after level 3 a "Grid complete" card offers Play again. The wiring of each level saves with ToJson to PlayerPrefs. Esc opens a Card menu with an auto play Switch. With no input for 5 seconds a bot wires the levels one wire per second.
Driller.unity DrillerController, DrillerGame, DrillerArt A mining game that brings the controls together. The pod digs down for ore, sells it on the surface and buys upgrades, until it finds the core crystal at the bottom; a sonar finds the ore in the dark ground: a Radar with pulse-reveal shows each ore when a ring reaches it. The HUD has two Gauges, an AnimatedLabel for the cash, a cargo bar with a Badge and an AlertStrip. The buildings are MDI windows: a DataGrid and a PieChart at the ore processor, an UnlockTree and an ItemCompare in the upgrade shop, and a Graph in the log book. The item wheel (RadialMenu) and the gas pocket (ProgressRing, GamepadGlyph) are on GlassPanels. A ParticleLayer sends each ore to the cargo bar and the coins of a sale to the cash, and AttentionFlash flashes the fuel meter when the tank is almost dry.
BossIntro.unity BossIntroController Six boss and hero intros in four looks, from the Toolbox parts and script-made pixel art. Comic (three intros, as in a looter shooter): the screen flashes, letterbox bars come in, a slab slides in, and the name slams down from three times its size; the camera shakes and a ParticleLayer throws sparks. Gothic: no flash; under a moon, the name fades in with wide letters that close up, in a serif font, and petals fall. Cyber: a neon grid scrolls, a dark panel slides in from the right, and the name glitches with a split-color shadow and throws data bits. Toon: a rounded slab drops in and bounces, the name pops up with a rainbow wave and confetti, and the eyes of the slime follow the pointer. In each look, a TypewriterLabel types the title, the name (an AnimatedLabel) gets its last effect, and the quote fades in. USS transitions on one class (bi--in) animate the slab, the name, the bars and the flash; a look class on the stage (bi-stage--gothic and others) changes the fonts, the layout and the transitions. The back, the figure and the front are pixel art PNGs from Tools/portraits/bossintro.mjs, white art tinted with the colors of each character and shown at a whole zoom with point filtering; the rays turn, the grid scrolls, the bats flap and the slime wobbles by transforms and sheet frames, with no repaint. Each of the four layers moves with the pointer at its own depth, so the picture has parallax. Replay plays the intro again, and Next intro shows the next one.
CardDuel.unity CardDuelController, CardDuelGame, DuelArt A card battle against a rival, Hexer, in the style of a trading card game. Each side has 20 life, a deck of 24 cards and mana that grows by one gem each turn, up to ten. Drag a card to the board or click it; a spell with a target draws a gold aim line to the pointer, and the valid targets glow. Click a ready creature, then an enemy creature or Hexer, to attack; a creature with Guard must be attacked first. Card triggers (when this enters, when you cast a spell, when this dies, at the start of your turn) queue more steps, and the board plays the steps one at a time: a flash on the source, sparks from a ParticleLayer to the target, a number from a FloatingTextLayer, a sound and a line in the battle log. Each card is a Card with its cost in a Badge; the hand is a fan of DragSource cards, and the board, the heroes and the creatures are DropTargets. One HoverCard shows a large copy of the card under the pointer, with a badge and a ToolTip for each keyword. StatBars show the life, an AnimatedLabel shows the name of a spell, a NotificationArea shows the turn banner, and a MessageBox ends the duel. The card pictures, the portraits and the card backs are pixel art that Tools/portraits/duel.mjs draws. The rules live in the plain class CardDuelGame, which EditMode tests run.
Heist.unity HeistController, HeistJob and HeistTask (in HeistGame.cs), HeistMap, HeistBackdrop A heist planned on a Timeline. A crew of three (Vex the lockpick, Sable the cat burglar and Bram the brawler) breaks into Grimsby Manor for one of three jobs, picked with an OptionSelector. Each task of the crew is a bar on the track of its crew member, with a stripe in the color of its place, and the two guards walk on their own tracks. Drag a bar, or select it and press Earlier or Later, to move it a minute at a time; a bar that starts before the task it needs, or that overlaps another task of the same crew member, gets a red edge, and the walks of the guards at the place of the selected task get a gold edge. Run plays the plan: the playhead moves through the night, the map moves the crew and the guards, opens the doors and puts out the lamp, the ObjectiveTracker ticks off each step, and a FloatingTextLayer cheers. A guard who sees a crew member at work, a locked door or a crew member in two places at once ends the night, and a Card says why. A plan that works earns one to three Rating stars for speed, and coins fly from the card to the ResourceCounter in the toolbar. The rules live in the plain class HeistJob, which EditMode tests run. On a gamepad, A picks up the selected task, the D-pad moves it, A places it and B puts it back.
Localization.unity LocalizationController, SampleLocalization The toolbox controls in nine languages (English, French, German, Spanish, Brazilian Portuguese, Russian, Japanese, Chinese and Korean) from JSON string files, one per language in Strings, with no package. A DropdownField selects the locale. Then the toolbox texts (Next, Cancel, Today, None), the window title, the tab titles, the column headers, the field labels and the help texts change at once. The DataGrid formats the prices with C2, and the MonthCalendar starts the week, in the culture of the locale. The cart line and the Buy question use plural forms. See Localization.
Styles.unity StylesController Each Toolbox control four times: in the workspace theme and in the Neon, Paper and Terminal style families of Styles.uss. A window holds one group (Inputs, Pickers, Display, Charts, Data, Layout, Dialogs), and the toolbar opens it. Each cell also shows other attributes of the control, for example a donut PieChart, a bar Graph or a DataGrid grouped by class. Each cell is a style scope, so the popups, the message boxes and the notifications take its family. The controller fills the controls that take their data from code. See Style families and style scopes.
SaveSlotListDemo.unity SaveSlotListDemoController SaveSlotList in four uses of a game, one per tab, with a status label that tells each selection, save, load and delete of the list, and the UXML and C# of each use. A strip over the list is the game: a picture of the place, the chapter and the play time, with Travel; a save keeps the place and the play time, and a load goes back to them. Pause menu: Save mode with no settings; a MessageBox asks before an overwrite and before a delete. The fields set ConfirmOverwrite, ConfirmDelete and ShowDelete. Title screen: Load mode with an autosave on top and eight slots; the game asks with MessageBox.ConfirmAsync before a load, and Loading shows a skeleton in each slot while the game reads the saves. Autosave and corrupt: the four kinds of slot and what each Mode lets the player do with them; Autosave now writes the autosave. Looks: Layout, ItemWidth, ItemHeight, Grid.Spacing and a class that hides the pictures, with the UXML and the USS. The pictures of the places come from SampleSaves, and the games are SaveSlot objects in memory.
ThemeDesignerDemo.unity ThemeDesignerDemoController, ThemePreview, ThemeDesign, ThemeTokens, ThemeUss, ThemeContrast A theme editor. A preview of buttons, fields, toggles, a slider, tabs, a list, badges, a stat tile, a chart, a window and a dialog follows a panel of color pickers and sliders for the tokens of a theme. Eight accent presets, a base theme dropdown, contrast badges (4.5:1 for text, 3:1 for a ring), Reset for each token and for all, and Save USS and Load USS for a sheet with only the changed tokens. Has a Show me tour.

A workspace in a hidden screen (display: none on the workspace or on an ancestor) keeps the viewport of its last layout, so its windows keep their places. A workspace that is hidden from the start reads its viewport when it shows.

The compare template of the DataGridDemo example sets x and y, so its windows open beside the list and cascade from there. No code places them.

Demo menu

The scene Assets/UIToolbox/DemoMenu.unity is the start of the demo. The left side has the logo, the Documentation button, the Credits button (a roll of the toolbox credits over the menu, closed by Escape or at the end of the roll) and the Quit button. The right side has a search field, a bar with a button for each group that scrolls the list to that group (the button of the group at the top of the list has the accent color), and a card with a screenshot for each other sample scene. While a card loads its screenshot, it shows a pulsing Skeleton in place of the picture and the text, and the card replaces it when the picture is ready.

The cards are in groups. Favorites comes first, then the whole game screens and the tools, then the groups of controls, then the use cases. The groups of controls follow the sections of the contents: a card shows one control, its title is the name of the control with the icon of the control before it, and its Docs button opens the page of that control. A demo of one control can use other controls too, as a game would.

Group Scenes
Game examples Screens of a game: Kingdom, Firefight, a game menu with settings, save and load, an inventory, a shop, a character sheet, a quest journal, a dialogue, a cinematic conversation on a dialogue wheel, a loading screen, a quest board, gathering notifications, a retro PC, the Crypt dungeon crawler, the Outpost third-person HUD, the Expedition crew sim, the Breach shooter HUD, the Reactor wiring puzzle, the Driller mining game and a boss intro.
Data and tools Units, Bindings and Factory.
Inputs, Display, Overlays and feedback, HUD, Navigation, Data and charts, Layout, Settings screens One card for each control, in the group of the section of its page in the contents, by the name of the control.
Windows and themes The workspace and its looks: the workspace, windows from UXML, tabs, window templates, Planets, animations, Styles, game skins and Localization.
Use cases Many controls together, by use: display controls, layout controls, navigation controls, a kanban board, the video director and quick time events.

The search field (a SearchDropdown) shows the cards whose title, group or text has the words you type, and the cards whose scene uses a control that you name: type Gauge, MaskImage or mask image to find each demo that uses it. The search forgives one typo in a word of four or more letters, so guage finds the gauges too, after the exact matches. It also knows the names that other UI kits and games give a control, so snackbar finds NotificationArea and treeview finds DataTree. The other names find the demo of that control only; to find every demo that uses a control, type its name or check it in the Controls list. Its list opens the scene of a pick, and it shows only the demos that pass the control filter.

On a gamepad, Y moves the focus to the search field and opens the on-screen keyboard with a Search key; the hint bar under the cards shows the button. The cards filter as you type. B closes the keyboard and returns the focus to the cards. Y is free in the menu, consoles use it for search, Start opens the Start menu and View belongs to the toolbar of a window. Mouse and keyboard work as before: click the field and type.

The Controls button next to the search opens a list of the controls with a check box for each, an All and a None button, and a field that filters the list. With some controls checked, the menu shows only the demos that use one of them, together with the search, and the button shows the number of checked controls; the filter stays when you come back from a demo. Card, CodeBlock, NavigableTabView, Separator and the TourOverlay of the Show me tour frame nearly every demo of a control, so they count only for their own demo.

Each card has a star and a Docs button over its screenshot:

The demo menu

A scene that the menu opens gets a way back:

To run the demo in the editor:

  1. In the Project window, open Assets/UIToolbox. Double-click DemoMenu.
  2. Press Play.
  3. Click a card, or type in the search field. The arrow keys or the gamepad move between the buttons and the cards, and Enter opens one.
  4. In the scene, click ◀ Demo menu to come back. In a full screen game, press Escape, then click Quit.
  5. Click Documentation to read the documentation. Click ◀ Demo menu or press Escape to come back.
  6. Click Quit, then Quit again in the box, to stop. In the editor, this stops play mode. In a player, this closes the program (SampleScreen.QuitAsync).

To run the demo as a player: click Tools > UI Toolbox > Samples > Run Demo Player. Unity builds the player into Builds/Smoke and starts it. The build blocks the editor for a few minutes.

The files are in Assets/UIToolbox/Examples/DemoMenu:

File Does
DemoMenuController Builds the cards from DemoMenuController.DEMOS, runs the search, the favorites and the docs screen.
DemoNavigation Open(path) loads a scene and notes that the menu opened it. Then the scene gets its header, or its back button and Escape menu (AddHeader, AddBackButton, AddEscapeMenu), and the gamepad parts: the Start menu (AddStartMenu, ShowStartMenuAsync) and the guard of a game that reads the pad (KeepPadForGame). A scene that you play directly gets nothing.
DemoFrame Adds the icon, Info, Docs and their windows to the header of a demo (Add), from its line in DEMOS. AlsoIn finds the other demos of a control, and ControlsIn the demos of the controls that a demo uses.
DemoDocsPage One document in a ScrollView: shows it, follows its links, scrolls to an anchor and frees its pictures. The docs screen and the Docs window use it.
DemoDocs Reads the table of contents, the documents, the screenshots and the control icons: in the project folder in the editor, in StreamingAssets/UIToolboxDocs in a player.
SampleScenes (in Assets/UIToolbox/Examples/Shared) LoadAsync(path, mode) loads a scene by its path in the editor and in a player. The Loading example uses it too.

To add a demo:

  1. Put the scene into Assets/UIToolbox/Examples/Scenes.
  2. Add one line to DemoMenuController.DEMOS: the group, the title, the scene path without Assets/UIToolbox/Examples/Scenes/ and .unity, one sentence for the card, the page of its documentation (a path in Documentation, with an optional #anchor), and a few more words that the search finds it by. A demo of one control goes in the group of the section of its page in the contents, with the name of the control as its title, in the order of the titles.
  3. Click Tools > UI Toolbox > Samples > Update Demo Keywords. It writes DemoMenu/DemoMenuKeywords.cs, the controls that each demo uses, from the files in Examples/<SceneName>. A test fails when this list is out of date.
  4. Save a 16:9 screenshot of the scene as Documentation/images/screens/<SceneName>.png. A card without a screenshot shows an empty picture.

The scene needs no change: the header, Info and Docs come from DemoNavigation and DemoFrame. A demo is a control demo when Documentation/images/icons/<Title>.png exists; then the card and the title bar of each window of the demo show that icon. Another demo shows Documentation/images/icons/demos/<SceneName>.png, and its Info lists its controls. Info shows the first paragraph of text of the page, at its #anchor, as the summary, or the sentence of the card when that part of the page has no text.

The docs screen shows the documents of Documentation/README.md, the table of contents. The left side is a DataTree: a category for each heading of the contents, with its documents below it. The right side shows the selected document. A link to another document or to a section opens it in the page, and a web link opens the browser. "Open the site in the browser" opens Documentation/site/index.html.

The docs screen of the demo menu

Tips: