widgets library
Ready-made Flutter widgets for a game's screen UI. Optional: a game runs without them, so the main library leaves them out.
import 'package:just_game_engine/just_game_engine.dart';
import 'package:just_game_engine/widgets.dart';
- Dialogue:
DialogueBoxWidgetandDialogueChoicesWidget, UI for aDialogueRunner. - Subtitles:
SubtitleOverlay, which shows aSubtitleController's cues. - Localization:
LocalizationBuilder,LocalizedText,LocaleSelectorandcontext.t()/context.tr()(L10nContext). They read theLocalizationScopethatGameWidgetputs around the game whenengine.context.localizationis set. - Camera:
GameCameraControls— wheel and pinch zoom, drag to pan, and on-screen zoom buttons. - Input, from
just_inputs:OnScreenControls(touch sticks and buttons, withOnScreenVisibility,OnScreenButtonFaceandOnScreenStickPainter) and the rebinding UI —RebindList,RebindButton,RebindRow,rebindRowsandBindingLabel.
Classes
- BindingLabel
-
How actions does the action at action, in words:
Space,Ⓐ. Follows the device its owner used last, so prompts change with the pad. - DialogueBoxWidget
- A ready-to-use dialogue box that renders the current DialogueLine from a DialogueRunner with an optional typewriter animation.
- DialogueChoicesWidget
- Displays the current set of DialogueChoices and calls DialogueRunner.selectChoice when the player taps one.
- GameCameraControls
- A widget that wraps child with scroll-wheel and on-screen +/− zoom controls that operate a Camera without rebuilding the child.
- LocaleSelector
- A widget that renders a locale switcher from a list of supported locales.
- LocalizationBuilder
- Rebuilds its subtree whenever the active locale changes.
- LocalizedText
- A Text widget that displays a localized string and automatically rebuilds when the locale changes.
- OnScreenButtonFace
- How an on-screen button looks — the game's and the editor's.
- OnScreenControls
- The asset's on-screen buttons and sticks, drawn and working — each with its own finger, so moving and jumping at once is two thumbs, not a fight over one.
- OnScreenStickPainter
- Draws a stick: its ring and its knob — the game's and the editor's.
- RebindButton
- One binding of one player, and a way to change it: press, then press the new control. Escape gives up.
- RebindList
- Every binding a player may change, in their scheme: one row each, with a way back to the default. The body of a Controls screen.
- RebindRow
- One line of a RebindList.
- SubtitleOverlay
- Wraps child and overlays a subtitle panel driven by controller.
Enums
- OnScreenVisibility
- When the on-screen controls show.
Extensions
- L10nContext on BuildContext
- Convenience extension on BuildContext for quick string lookups.
Functions
-
rebindRows(
PlayerInput player, {List< String> ? maps}) → List<RebindRow> -
The rows a RebindList shows for
player: every rebindable action inmaps, each binding in their scheme, a composite as its parts.