Skip to content
Skills Library
Programming · Building & coding

tile-picking-interaction

/tile-picking-interaction

Use when converting a mouse/touch position into the correct isometric tile for selection, highlighting, and placement.

Licence
MIT
Last repository change
12.08.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.08.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when converting a mouse/touch position into the correct isometric tile for selection, highlighting, and placement.

Original author description

Use when converting a mouse/touch position into the correct isometric tile for selection, highlighting, and placement.

How it works

  1. Overview
  2. When to Use
  3. Process
  4. Rationalizations (Stop Lying to Yourself)
  5. Red Flags - STOP if you catch yourself:
  6. Verification
Original SKILL.md headings · 49 lines, 261 words
SKILL.md preview
---
name: tile-picking-interaction
description: Use when converting a mouse/touch position into the correct isometric tile for selection, highlighting, and placement.
license: MIT
---

# Tile Picking & Interaction

## Overview

Picking is screen->grid with the camera inverse applied first. This skill turns a pointer position into the exact tile under it, with a highlight and hit-test that respects camera pan/zoom.

## When to Use

- Clicking selects the wrong tile.
- You need hover highlight or click-to-place.
- Picking ignores camera pan/zoom.

## Process

1. Take the pointer position in screen space.
2. Apply the inverse camera transform (see `camera-pan-zoom-controls`).
3. Apply screen->grid from `isometric-grid-math` and round to a tile.
4. Clamp the result to map bounds and check walkable if needed.
5. Draw a highlight on the picked tile for feedback.
6. On click, dispatch the tile coord to the gameplay handler.
7. Test picking at multiple zoom levels and pan offsets.

```js
const world = screenToWorld(pointer, cam);
const tile = worldToGrid(world, W, H); // then round
```

## Rationalizations (Stop Lying to Yourself)

| Excuse | Reality |
|---|---|
| "I will skip the camera inverse" | Then picking breaks the moment you pan/zoom. Always invert. |
| "No need to highlight" | Players need feedback on what they will click. Highlight. |

## Red Flags - STOP if you catch yourself:

- Picking that ignores camera pan/zoom.
- No rounding so edge tiles mis-select.
- No visual highlight feedback.

## Verification

You are NOT done until every box is checked:

- [ ] Picked tile is correct at any pan and zoom.
- [ ] Hover highlight matches the actual selected tile.
- [ ] Clicks dispatch the right grid coordinate.

Versions

The database has no other skills named tile-picking-interaction.

Database snapshot: 13.11.2026 · package version 79fcf4101940 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95threejs-interaction
    Three.js interaction - raycasting, controls, mouse/touch input, object selection. Use when handling user input, implementing click detection, adding camera controls, or creating interactive 3D experiences.
  • 95threejs-interaction
    Three.js interaction - raycasting, controls, mouse/touch input, object selection. Use when handling user input, implementing click detection, adding camera controls, or creating interactive 3D experiences.
  • 100threejs-interaction
    Three.js interaction - raycasting, controls, mouse/touch input, object selection. Use when handling user input, implementing click detection, adding camera controls, or creating interactive 3D experiences.
  • 95cesiumjs-interaction
    CesiumJS interaction and picking - ScreenSpaceEventHandler, multi-key KeyboardEventModifier input actions, Scene.pick, Scene.drillPick, Scene.pickPosition, Scene.snap edge snapping (1.144), mouse and touch events. Use when handling user clicks on the globe, selecting entities or…
  • 100threejs-interaction
    Implement and debug Three.js interaction with Raycaster, pointer and touch coordinate conversion, hover/selection state, camera controls, dragging, keyboard input, and world-to-screen projection. Use when picking objects, adding OrbitControls or PointerLockControls, handling…
  • 100input-system
    Handle player input in Godot across keyboard, mouse, gamepad, and touch devices. Use this skill when configuring input actions, processing keyboard/mouse/gamepad events, implementing touch controls, setting up virtual joysticks, managing mouse modes, or building remappable input systems.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.