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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cspell/project-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,5 @@ winit
xadvance
yoavbls
Zoltan
rrggbb
rrggbbaa
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **ecs:** Systems and system groups can run conditionally. Pass a `runIf` function of the world to `addSystem` or `addSystemGroup`, and the world checks it each tick just before the system or group would run, skipping it (and its query) when it returns `false`. `EcsWorld` also gains a built-in `firstSystemGroup` that runs before every other group of the tick. A group ordered `after` it joins the start of the tick, before every other group. Ordering a group `before` the first group throws, and so does ordering a group before a start-of-tick group, or a start-of-tick group after one that isn't
- **states:** New `@forge-game-engine/forge/states` module for a game's top-level states (menu, playing, paused, game over). `createGameState(world, initial)` returns a `GameState` whose `set` switches state at the start of the next tick. Its `exitGroup` and `enterGroup` run once per transition, before any other system, holding systems that use `onExit`/`onEnter` as their `runIf`; `inState` runs a system only in some states. The initial state is entered on the first tick, and setting the current state again restarts it. `addStateScopedComponent` removes an entity when its state leaves one of `removeOnExit` or enters one of `removeOnEnter`. See the new Game States guide and demo
- **rendering:** `getCameraView(world, camera, renderContext)` (and `computeCameraView(camera, position, renderContext)` for systems that already hold the camera's components) returns what a camera sees: the world area it shows (`bounds`, `size`, accounting for its position and zoom), its `pixelsPerUnit` in CSS pixels, and `worldToViewport`/`viewportToWorld` conversions to and from CSS pixels on the canvas. To place something drawn by one camera over something drawn by another, convert through the viewport: `hudView.viewportToWorld(gameView.worldToViewport(position))`
- **text:** Rich text tags. `TextEcsComponent.text` (and `shapeText`) parse `<b>...</b>` and `<color=#rrggbb>...</color>` (`#rgb`, `#rgba` and `#rrggbbaa` too) to style part of a string. Tags are stripped before shaping, so they never change kerning or wrapping. `<b>` draws a synthetic bold from the same atlas, thickening each glyph by `FAUX_BOLD_EMBOLDEN` ems per side and widening its advance to match. A `<color>` replaces the text's `color`, alpha included. Markup that isn't a valid tag, such as `HP < 50%` or `<i>`, is drawn as literal text, so a string that happens to contain `<b>` or `<color=#...>` now renders styled. `parseRichText` is public, and `GlyphQuad` gains `color` and `embolden`
- **text:** The engine's default font can be imported through a bundler from `@forge-game-engine/forge/fonts/default/default.json` and `@forge-game-engine/forge/fonts/default/default.png`, so you no longer need to copy it out of `node_modules`

#### Changed
Expand Down
254 changes: 0 additions & 254 deletions design/rich-text-tags.md

This file was deleted.

8 changes: 4 additions & 4 deletions design/ui-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ unblocked.
CSS-ish style sheets, no parser. Layout is expressed in TypeScript.
- **No visual editor.** The engine is code-only by design. A future editor may
read and write this system, but is out of scope here.
- **No rich-text document layout.** Single-font, single-style runs per text
element for v1. No inline images, no bidirectional text, no complex script
shaping (Arabic, Devanagari).
- **No rich-text document layout.** One font per text element, styled only
by inline `<b>`/`<color>` tags. No inline images, no bidirectional text, no
complex script shaping (Arabic, Devanagari).
- **No DOM-backed widgets.** The one place browser text entry is unavoidable
(IME, mobile keyboards, clipboard) is isolated as an input primitive in
`/src/input`, not as DOM inside a UI component — so this module stays
Expand Down Expand Up @@ -1500,7 +1500,7 @@ widest label with no hand-computed offsets. Documented in the UI doc's "Layout g
| 5.4 | **Landed**, outside this module: text effects (outline, drop shadow, glow as MSDF shader parameters) shipped via `/src/text` ([#608](https://github.com/Forge-Game-Engine/Forge/pull/608), [#610](https://github.com/Forge-Game-Engine/Forge/pull/610)), documented in the text module's Text Effects doc. Nothing left to do here. | S |
| 5.5 | **Landed.** Tooltips + a UI-safe-area concept for notched displays | S |
| 5.6 | **Landed.** UI stress-test demo - dirty-tracking optimization evaluated and deferred, not warranted at the scale measured; see DL-12 | M (DL-12) |
| 5.7 | **Scoped out.** Rich text tags (`<b>`, `<color>`) — scoping surfaced real architectural gaps (no per-glyph styling data model, no bold-weight concept in the font-atlas pipeline); see [`design/rich-text-tags.md`](./rich-text-tags.md) for the design addendum instead of a guessed implementation. | L |
| 5.7 | **Landed.** Rich text tags (`<b>`, `<color=...>`) in `TextEcsComponent.text`: `shapeText` parses them into per-glyph color and a synthetic-bold embolden; see the Rendering Text guide. | L |

---

Expand Down
Loading
Loading