Clip the children of an object to a rectangle, so a scrolling list (inventory grid, dialog text, a log) can move smoothly and anything outside the area is cut off.
Motivation: the inventory grid in cbbf160bb7e8 should scroll vertically. Today the engine cannot clip at all, so only row-by-row scrolling with fixed slots is possible.
Planned behavior
An object gets a clip area. All children on all levels are drawn only inside it. Nested clip areas intersect.
Clicks and hover (On click, Is hovered) do not hit parts that are cut off.
The scene view clips the same way as the game, so what you see while editing is what the game shows.
Existing projects load unchanged (clipping off).
Open questions
Where does clipping live?
a) A switch Clip children on sprites. It clips to the sprite's own box, plus Clip padding (one number, inwards) so the frame of a window stays visible. (proposal: the inventory window sprite just gets the switch, padding = frame width)
b) A new object type Clip area with width/height (dashed outline in the editor, invisible in the game) that clips its children.
c) Both.
Scene view: clip always, or show the cut-off parts faintly (like Godot) while the object is selected, so you can still find and drag them?
Scrolling input: a new event node On mouse wheel (delta) as part of this issue, so the grid can actually be scrolled with the wheel? (proposal: yes, it is small and the feature is hardly usable without it)
Scroll bar: only the engine feature here, and the inventory gets its scroll bar as sprites in the project graph? Or a ready-made scroll container object? (proposal: engine feature only, no ready-made scroll container)
Not in scope
Masks by texture shape (alpha masks).
Clip the children of an object to a rectangle, so a scrolling list (inventory grid, dialog text, a log) can move smoothly and anything outside the area is cut off.
Motivation: the inventory grid in `cbbf160bb7e8` should scroll vertically. Today the engine cannot clip at all, so only row-by-row scrolling with fixed slots is possible.
## Planned behavior
- An object gets a clip area. All children on all levels are drawn only inside it. Nested clip areas intersect.
- Clicks and hover (`On click`, `Is hovered`) do not hit parts that are cut off.
- The scene view clips the same way as the game, so what you see while editing is what the game shows.
- Existing projects load unchanged (clipping off).
## Open questions
1. **Where does clipping live?**
- a) A switch **Clip children** on sprites. It clips to the sprite's own box, plus **Clip padding** (one number, inwards) so the frame of a window stays visible. *(proposal: the inventory window sprite just gets the switch, padding = frame width)*
- b) A new object type **Clip area** with width/height (dashed outline in the editor, invisible in the game) that clips its children.
- c) Both.
2. **Scene view:** clip always, or show the cut-off parts faintly (like Godot) while the object is selected, so you can still find and drag them?
3. **Scrolling input:** a new event node **On mouse wheel** (delta) as part of this issue, so the grid can actually be scrolled with the wheel? *(proposal: yes, it is small and the feature is hardly usable without it)*
4. **Scroll bar:** only the engine feature here, and the inventory gets its scroll bar as sprites in the project graph? Or a ready-made scroll container object? *(proposal: engine feature only, no ready-made scroll container)*
## Not in scope
- Masks by texture shape (alpha masks).
admin
added this to the Development project 2026-09-28 21:17:44 +02:00
admin
added the question label 2026-09-28 21:18:21 +02:00
admin
moved this to Next in Development on 2026-09-28 21:21:34 +02:00
Umgesetzt in 0c41cb9 und laut deinen Antworten: 1b (eigener Objekttyp), blasser Rest im Scene-View, On mouse wheel mit dabei, kein fertiger Scroll-Container.
Clip area
Neuer Objekttyp Clip area mit width und height (Standard 200 x 150). Die Area dreht, skaliert und spiegelt mit ihrem Parent. Breite und Höhe lassen sich mit den Größen-Griffen ziehen.
Alles darunter wird auf jeder Ebene nur innerhalb gezeichnet, im Scene-View wie im Spiel. Verschachtelte Areas schneiden auf die Schnittfläche, gedrehte Areas schneiden auch richtig.
On click, Is hovered und On mouse wheel treffen den abgeschnittenen Teil nicht, der Scene-View pickt ihn auch nicht.
Im Scene-View ist die Area ein gestrichelter Rahmen und nur am Rand greifbar. Das Auge unter Shape blendet ihn aus. Im Spiel ist sie unsichtbar.
Ist ein Objekt darunter oder darüber ausgewählt, zeigt der Scene-View den abgeschnittenen Rest mit 30 % Deckkraft, und dort ist er greifbar.
Der Properties-Node kennt den Typ Clip area.
On mouse wheel
Feuert nach der Regel von On click. delta zählt in Rastungen, positiv ist nach unten, ein Trackpad liefert Bruchteile. Dazu kommen x/y.
Grenzen
Den blassen Rest zeigen nur Sprites und Texte. Tilemaps und Partikel werden geschnitten, aber nicht blass gezeigt.
Masken nach Texturform gibt es nicht.
Tests
./check.sh: 2773 Tests, CHECK EXIT 0
Voller e2e-Lauf lokal: ALL PASSED, 1549 Checks (gemessen)
12 Unit-Tests in tests/core/clip-areas.test.ts, neues e2e-Modul 58 mit 5 Checks und echter Maus bzw. echtem Mausrad
Gegenproben: 6 Unit, 3 Browser, alle greifen
Wiki: Concepts, Behaviors, Architecture, Development (c86b7ba).
Umgesetzt in `0c41cb9` und laut deinen Antworten: **1b** (eigener Objekttyp), blasser Rest im Scene-View, `On mouse wheel` mit dabei, kein fertiger Scroll-Container.
**Clip area**
- Neuer Objekttyp *Clip area* mit `width` und `height` (Standard 200 x 150). Die Area dreht, skaliert und spiegelt mit ihrem Parent. Breite und Höhe lassen sich mit den Größen-Griffen ziehen.
- Alles darunter wird auf jeder Ebene nur innerhalb gezeichnet, im Scene-View wie im Spiel. Verschachtelte Areas schneiden auf die Schnittfläche, gedrehte Areas schneiden auch richtig.
- `On click`, `Is hovered` und `On mouse wheel` treffen den abgeschnittenen Teil nicht, der Scene-View pickt ihn auch nicht.
- Im Scene-View ist die Area ein gestrichelter Rahmen und nur am Rand greifbar. Das Auge unter *Shape* blendet ihn aus. Im Spiel ist sie unsichtbar.
- Ist ein Objekt darunter oder darüber ausgewählt, zeigt der Scene-View den abgeschnittenen Rest mit 30 % Deckkraft, und dort ist er greifbar.
- Der `Properties`-Node kennt den Typ *Clip area*.
**On mouse wheel**
- Feuert nach der Regel von `On click`. `delta` zählt in Rastungen, positiv ist nach unten, ein Trackpad liefert Bruchteile. Dazu kommen `x`/`y`.
**Grenzen**
- Den blassen Rest zeigen nur Sprites und Texte. Tilemaps und Partikel werden geschnitten, aber nicht blass gezeigt.
- Masken nach Texturform gibt es nicht.
**Tests**
- `./check.sh`: 2773 Tests, CHECK EXIT 0
- Voller e2e-Lauf lokal: ALL PASSED, 1549 Checks (gemessen)
- 12 Unit-Tests in `tests/core/clip-areas.test.ts`, neues e2e-Modul 58 mit 5 Checks und echter Maus bzw. echtem Mausrad
- Gegenproben: 6 Unit, 3 Browser, alle greifen
Wiki: *Concepts*, *Behaviors*, *Architecture*, *Development* (`c86b7ba`).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Clip the children of an object to a rectangle, so a scrolling list (inventory grid, dialog text, a log) can move smoothly and anything outside the area is cut off.
Motivation: the inventory grid in
cbbf160bb7e8should scroll vertically. Today the engine cannot clip at all, so only row-by-row scrolling with fixed slots is possible.Planned behavior
On click,Is hovered) do not hit parts that are cut off.Open questions
Not in scope
bei 1. nehmen wir variante "b)", restliche Vorschläge passen
Umgesetzt in
0c41cb9und laut deinen Antworten: 1b (eigener Objekttyp), blasser Rest im Scene-View,On mouse wheelmit dabei, kein fertiger Scroll-Container.Clip area
widthundheight(Standard 200 x 150). Die Area dreht, skaliert und spiegelt mit ihrem Parent. Breite und Höhe lassen sich mit den Größen-Griffen ziehen.On click,Is hoveredundOn mouse wheeltreffen den abgeschnittenen Teil nicht, der Scene-View pickt ihn auch nicht.Properties-Node kennt den Typ Clip area.On mouse wheel
On click.deltazählt in Rastungen, positiv ist nach unten, ein Trackpad liefert Bruchteile. Dazu kommenx/y.Grenzen
Tests
./check.sh: 2773 Tests, CHECK EXIT 0tests/core/clip-areas.test.ts, neues e2e-Modul 58 mit 5 Checks und echter Maus bzw. echtem MausradWiki: Concepts, Behaviors, Architecture, Development (
c86b7ba).