Add viewport tools to select, move, rotate and scale from DevTools
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
Start by getting agreement on how the game-side overlay attaches and blocks input; the issue says this design must be settled before implementation. Then work through the suggested PR sequence, beginning with the connector, tool state and input blocking. Done means the acceptance criteria pass, including tests for drag and coordinate math.
索引モデルが issue の本文から書いたものです。
説明
Problem to solve
Components can only be changed through number fields in the DevTools extension. There is no way to click a component in the game to select it, or to drag it into place.
Proposal
DevTools runs apart from the game and only talks to it through service extensions, so this can't live only in the extension. The proposal is a game-side overlay: the extension turns a tool on through a new connector, while hit testing, gizmo drawing and drags all run in the game process. The extension and the game share the selection.
The design needs agreement before implementation, especially how the overlay attaches to the game and how game input is blocked.
Tools: Interact (the default, with no effect on the game), Select, Move, Rotate, Scale.
Selection
- Get candidates with
componentsAtPoint(point).whereType<PositionComponent>(), topmost first. - Clicking again at the same point selects the candidate after the current one, wrapping around, so overlapping components can be reached.
Coordinates
- Map local points to the canvas by walking up the parents and applying each transform. A
Worldis only rendered through the cameras that look at it, so the mapping needs a camera, and a component can have one gizmo per camera. - Keep the gizmo outline as four corners, not a rectangle, so rotation, scale and flips on the component and its ancestors all work.
Drags
- Capture what the drag needs when it starts, so it keeps following the pointer even when a camera follows the dragged component.
- Measure from the pointer-down position, so the drag slop doesn't offset the component.
- Support cancelling, which restores the starting value.
- Move: convert the drag into the parent's space. Axis handles move along the component's local axis.
- Rotate: turn by the angle the pointer sweeps around the anchor, and invert the direction when the parent space is mirrored.
- Scale: dragging away from the anchor by one axis length doubles the scale. The square between the axes scales both uniformly.
Handles: suggested sizes are 40 for the axis, 8 to 18 for the free square, 50 for the ring radius, and a 6 pixel grab tolerance. All are fixed in canvas space regardless of zoom.
Snapping: while Shift is held, snap to 8 units, 15° or 0.1 scale, and re-apply the current drag when Shift is pressed or released. On a rotated axis, snap the distance moved so the component stays on the axis.
Suggested PRs
- Connector, tool state and input blocking.
- Click to select, synced with the extension's tree.
- Coordinate mapping and gizmo drawing.
- Move tool.
- Rotate tool.
- Scale tool.
- Shift snapping.
Acceptance criteria
- With the Interact tool, or with DevTools closed, the game behaves exactly as it does today.
- Nothing from this feature runs in release builds.
- The game receives no pointer events while another tool is active.
- Gizmos stay correct with camera zoom, rotated or flipped parents, and multiple cameras.
- Tools work while the game is paused, and changes are visible straight away.
- Drag and coordinate math is covered by tests.
More information
Part of the work to move the flame_studio debugging features to flame_devtools. Do this last, since it is the largest piece.
- 主要言語
- Dart
- スター
- 10.8k
- フォーク
- 1.1k
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 62
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
flame-engine/flame のほかの issue
-
`Viewfinder.visibleGameSize` is not reapplied when the viewport changes size対応中かも @ufrshubham が今日担当しました。 オープンbug
flame-engine/flame#4204 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`Viewfinder.visibleGameSize` zooms in too far with a `FixedResolutionViewport`対応中かも @ufrshubham が今日担当しました。 オープンbug
flame-engine/flame#4203 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Camera bounds with `considerViewport: true` are not updated when the viewport is resized対応中かも @ufrshubham が今日担当しました。 オープンbug
flame-engine/flame#4202 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`CameraComponent.setBounds` with `considerViewport: true` only works for bounds that start at (0, 0), at zoom 1対応中かも @ufrshubham が今日担当しました。 オープンbug
flame-engine/flame#4201 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`findPostProcessFromContext` returns `null` for components rendered with `CameraComponent.postProcess`対応中かも @ufrshubham が今日担当しました。 オープンbug
flame-engine/flame#4200 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
flame-engine/flame の issue をすべて見る
似ている issue
-
[CarouselView] Crash (RangeError / ArgumentError) when children or itemCount is empty with infinite: true or CarouselController.animateToItem対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンp: material_ui package platform-android platform-ios platform-linux platform-macos platform-web team-design
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
flutter/flutter#195878 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[genkit_google_genai] Gemini tool call with no arguments fails with "requires a non-null input"対応中かも @kenzieschmoll が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
genkit-ai/genkit-dart#692 ·
メンテナーはふだん 11 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
lollipopkit/flutter_server_box#1851 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信