feat(client): sprite-accurate click selection + overhead damage numbers #63

Merged
marco merged 1 commit from feat/click-select-sprite into main 2026-07-19 07:25:54 +02:00
Owner

Two client UX fixes for tall sprites — both surfaced by the training dummy.

Click-to-select by sprite bounds

Target selection hit-tests the cursor against each creature's drawn sprite rectangle (front-most wins when they overlap), instead of matching the exact tile. UO sprites are drawn well above their tile, so clicking the visible body now engages the creature — before, only clicking the base tile worked (the "clicking the dummy's body does nothing" report). The geometry is a pure, unit-tested SpriteHitBox in Client.Core.

Overhead damage numbers

Floating damage anchors to the target's head (top of sprite) rather than its feet, so damage no longer appears halfway up a tall creature (the dummy report). Mobile/Player expose an OverheadPosition derived from the current frame's anchor.

just lint -> 0 warnings. just test -> full suite green (Client.Core 49 incl. 3 new SpriteHitBox tests, GameServer 139).

Definition of Done (delta)

  • Clicking anywhere on a creature's sprite selects it (verified geometry via unit tests; visual confirm via just dev).
  • Damage numbers float above the target's head, not mid-sprite.
  • Whole solution builds, zero warnings, tests green.
Two client UX fixes for tall sprites — both surfaced by the training dummy. ## Click-to-select by sprite bounds Target selection hit-tests the cursor against each creature's **drawn sprite rectangle** (front-most wins when they overlap), instead of matching the exact tile. UO sprites are drawn well above their tile, so clicking the visible **body** now engages the creature — before, only clicking the base tile worked (the "clicking the dummy's body does nothing" report). The geometry is a pure, unit-tested `SpriteHitBox` in `Client.Core`. ## Overhead damage numbers Floating damage anchors to the target's **head** (top of sprite) rather than its feet, so damage no longer appears halfway up a tall creature (the dummy report). `Mobile`/`Player` expose an `OverheadPosition` derived from the current frame's anchor. `just lint` -> 0 warnings. `just test` -> full suite green (Client.Core 49 incl. 3 new SpriteHitBox tests, GameServer 139). ## Definition of Done (delta) - [x] Clicking anywhere on a creature's sprite selects it (verified geometry via unit tests; visual confirm via `just dev`). - [x] Damage numbers float above the target's head, not mid-sprite. - [x] Whole solution builds, zero warnings, tests green.
feat(client): sprite-accurate click selection + overhead damage numbers
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m34s
0df28f49ed
Two UX fixes for tall sprites (the training dummy made both obvious):

- Click-to-select a creature now hit-tests the mouse against each mobile's
  drawn sprite bounds (front-most wins on overlap), not the exact tile. Clicking
  the visible body engages it, instead of only the base tile. The geometry lives
  in a pure, unit-tested SpriteHitBox in Client.Core.
- Floating damage numbers anchor to the target's head (top of sprite) instead of
  its feet, so damage no longer appears halfway up a tall creature. Mobile/Player
  expose an OverheadPosition from the current frame's anchor.
marco merged commit e2387d3536 into main 2026-07-19 07:25:54 +02:00
marco deleted branch feat/click-select-sprite 2026-07-19 07:25:54 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo!63
No description provided.