respectCamera and respectViewport proposal: coordinate system enum (#1167)

* Coordinate system

* Fixess

* .

* .

* Fix tests

* Rename CoordinateSystem to PositioningType

* Update docs for PositioningType

* Use switch instead of if-else

* PositioningType -> PositionType

* Don't do unnecessary transforms

* Added tests for PositionType.widget

* Update doc/components.md

Co-authored-by: Luan Nico <luanpotter27@gmail.com>

* Added PositionType tests

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
This commit is contained in:
Luan Nico
2021-12-08 04:07:36 -05:00
committed by GitHub
parent 5b7f31be19
commit 07ab8ce9c9
14 changed files with 195 additions and 65 deletions

View File

@ -163,11 +163,11 @@ class JoystickAdvancedExample extends FlameGame
speedText = TextComponent(
text: 'Speed: 0',
textRenderer: _regular,
)..respectCamera = false;
)..positionType = PositionType.viewport;
directionText = TextComponent(
text: 'Direction: idle',
textRenderer: _regular,
)..respectCamera = false;
)..positionType = PositionType.viewport;
final speedWithMargin = HudMarginComponent(
margin: const EdgeInsets.only(