Let the mouse nodes look through a camera (#304)
- Behaviors (Mouse) and Concepts explain the new camera input of Mouse position and Is hovered. - Architecture names pointerThrough. - Development counts 1730 e2e checks.
1 parent
30c94a3ffe
commit
bfbab14701
4 files changed
+16
-4
No files matched your search
+1
-1
@@ -174,7 +174,7 @@ src/viewport/ WorldViewport (the drawing of a world or a holder, the ba
|
||||
a `ViewSource` — the project and word of a change — so a released game draws without the
|
||||
editor, #266; a view through a camera keeps only what that camera `Sees` and lays one
|
||||
see-through view per overlay camera over itself, each handed its view and frame and
|
||||
drawn like any other, #302), gamePointer (the mouse handed to a running world), projectFiles (the file
|
||||
drawn like any other, #302), gamePointer (the mouse handed to a running world, in world units and on the main camera's picture, which `World.pointerThrough` turns into any other camera's view with `pointerThrough` in `core/properties/camera`, #304), projectFiles (the file
|
||||
libraries pointed at the server, and what a project names fetched ahead),
|
||||
fullscreen + FullscreenCorner (the browser's Fullscreen API, when the corner button shows,
|
||||
and the button itself, shared by the Game tab and the released game, #267),
|
||||
|
||||
+8
@@ -465,6 +465,14 @@ the inspector).
|
||||
`On mouse wheel` follows the same rule; what turned within one frame arrives as one `delta`,
|
||||
one notch of a mouse wheel being 1. A part a clip area cuts off is never hit, by neither of
|
||||
them nor by `Is hovered` (see [Concepts](Concepts)).
|
||||
`Mouse position` and `Is hovered` take a **`camera`** (#304). Left open, they see the mouse
|
||||
through the main camera as before. With a camera, they see it through that camera's picture as
|
||||
an overlay camera lays it on, so a HUD button that only an overlay camera shows can be hovered.
|
||||
`in view` then says whether the mouse is on that camera's picture; a camera that is not drawn
|
||||
(switched off, or a second camera without *Overlay*) never has it. The position is kept on the
|
||||
picture, so a main camera on the move does not drag the mouse across the HUD. `On click` and
|
||||
`Mouse button` stay with the main camera. A HUD button is clicked with `pressed` of
|
||||
`Mouse button` together with `Is hovered` through its camera.
|
||||
- **Idiomatic movement** (the demo's "Mover", five nodes): `On update → Move(Owner, dx = Axis
|
||||
input.x, dy = Axis input.y, scale = speed, dt = On update.dt)`, `speed` being a `Variables` node.
|
||||
- **Idiomatic platformer** (the example game's "Player"): `On update` adds `gravity · dt` to a
|
||||
|
||||
+6
-2
@@ -54,13 +54,17 @@ the main camera at `z` 0. Something meant to lie *below* the world goes to a cam
|
||||
that is made the main one, with the game camera as an overlay. The main camera decides the size
|
||||
of the picture and the zoom of the tab; an overlay camera is fitted into that picture without
|
||||
distortion, so one of the same size and zoom covers it exactly. The mouse is reported through the
|
||||
main camera (#304 is about asking another). Two cameras switched on without *Overlay* draw as
|
||||
main camera; `Mouse position` and `Is hovered` ask another one through their `camera` input
|
||||
(#304, see *Mouse* in [Behaviors](Behaviors)). Two cameras switched on without *Overlay* draw as
|
||||
before: through the first one only. The Scene tab shows every layer. A camera can also wear a
|
||||
shader over its picture (#299, see *Wearing a shader* in [Shaders](Shaders)); it works on that
|
||||
camera's picture alone, before the pictures are laid on top of each other.
|
||||
Measured in the checks (step 63): a green sprite of an overlay camera at `z` -10 covers a red one
|
||||
of the main camera at `z` 1000, a `UI` sprite in front of the main camera and a `Default` one in
|
||||
front of the overlay stay away, and the same holds in the running game.
|
||||
front of the overlay stay away, and the same holds in the running game. With the overlay camera
|
||||
zoomed 2x, the real mouse 30 units right of the centre of the picture lies 15 units right of the
|
||||
overlay camera's centre (2015 at a camera on 2000): `Is hovered` through it finds the green
|
||||
sprite, through the main camera not.
|
||||
|
||||
**A clip area cuts what is below it** (#260). It is an object of its own (*Clip area*, `+`
|
||||
menu) with a `width` x `height`, and it turns, scales and mirrors with its parent like a sprite.
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ php tests/php/accounts.test.php # the API's accoun
|
||||
# has and the web server's container has not (SKIP there)
|
||||
php tests/php/snapshots.test.php # the snapshot store (#231), the same way
|
||||
php tests/php/releases.test.php # the release store (#266), the same way
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1729 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1730 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 — a subset while working on one step
|
||||
./e2e.sh start [GM_STEPS] # the same run detached, see below
|
||||
./e2e.sh status # live progress, or the last run's result
|
||||
|
||||
Reference in new issue
Block a user