libGDX input and viewports
Keeps touches and clicks aligned with the right camera when the window shape changes. It gives the game world and interface separate sizing and input policies where needed.
libgdx-input-viewports
See how it helpsWhen is it useful?
Use it when taps or dragging land in the wrong place after resizing, camera movement or interface overlays.
What does it help you do?
- Chooses separate viewport policies for gameplay and interface.
- Transforms input through the appropriate camera after resizing.
- Orders input processors with explicit event consumption.
Try asking this
Our tower-defense game has a world camera and a fixed purchase bar. Test a tall phone, wide desktop and letterboxed window. Unproject input through the correct viewport so tapping the bar buys once, while tapping the battlefield selects the intended tile.
Detailed documentation
Read the skill’s original instructions, examples and checks in their authored language.
Show less
libGDX — input viewports
Use when implementing libGDX touch, controller input, cameras, resize or UI coordinates.
Version and project gate
Inspect Gradle wrapper and modules, libGDX/backend versions, Java toolchain, ApplicationListener/Game/Screen structure, AssetManager ownership, viewport policy, native libraries and supported desktop/mobile/web targets. Never turn a task into an engine upgrade without the user’s intent. Read the version-matching official reference when an API decision depends on it.
Work
Declare world units and choose the appropriate viewport policy for gameplay and UI separately. Apply viewport updates at resize and convert input through the correct viewport/camera. Order input processors deliberately and define who consumes each event.
Deliver
A coordinate/input contract and usable controls at intended aspect ratios. Keep the change in the existing project structure; separate actual observations from the proposed acceptance scenario below.
Failure to prevent
Mixing screen and world coordinates or using the gameplay viewport for UI can create offset hit areas.
Acceptance scenario
Resize, letterbox, tap corners, drag across UI and verify the same gameplay target under camera movement. Follow the project’s execution and verification permissions. If execution or a target device is unavailable, provide the reproduction steps and name the remaining uncertainty; do not mark it passed.
Scope and sources
This skill belongs to Keiko. Agent selection is restricted by Orqestria’s assigned-agent policy, including forced skill selection; instruction text alone is not an access control. These are original task workflows researched from official documentation, not a copied or endorsed vendor skill.
Task-specific official references
Included files 1
SKILL.md
