# Bevy Adapt Mobile To Desktop

Bevy ECS skill for adapting a Bevy mobile game to desktop.

- Repository: https://github.com/thedivergentai/Game-Dev-Agentic-Skills (917 stars)
- Category: Engineering
- License: LGPL-3.0
- Last updated: 2026-10-16
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-adapt-mobile-to-desktop -g -a claude-code -y`
Codex: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-adapt-mobile-to-desktop -g -a codex -y`
Cursor: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-adapt-mobile-to-desktop -g -a cursor -y`
Gemini CLI: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-adapt-mobile-to-desktop -g -a gemini-cli -y`

## Description

Bevy ECS skill for adapting a Bevy mobile game to desktop. Keywords: Bevy, desktop, mouse, keyboard, adapt, window.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Bevy adapt mobile to desktop

## When to use

Load this when a touch-first game gains a window, mouse, and keyboard. Window setup is bevy-platform-desktop.

## ECS shape

- **Window:** `Window`, `WindowMode`, and `PrimaryWindow`.
- **Input:** keyboard, mouse, and gamepad features are named on the crate page and already used by bevy-input-handling.
- **Pointer:** `CursorOptions` on the primary window. `CursorGrabMode::None`, `Confined`, or `Locked`.

## Desktop choices

| Need | Bevy idiom |
| --- | --- |
| On-screen buttons | Keyboard and mouse via bevy-input-handling, writing the same intent component. |
| Wider layout | A wider `WindowResolution` on the primary `Window`. |
| Pointer lock | `CursorOptions.grab_mode = CursorGrabMode::Locked` and `visible = false`. |

## Scope

- Keyboard and mouse write a `MoveIntent` component. Touch buttons can keep writing that same component.
- Window mode, resolution, present mode, and cursor grab live on the primary window entity.

## Examples

```toml
[package]
name = "desktop_port"
version = "0.1.0"
edition = "2021"

[dependencies]
bevy = "0.20"
```

Open a windowed 1920x1080 view and lock the pointer while aiming.

```rust
use bevy::window::{
    CursorGrabMode, CursorOptions, MonitorSelection, PresentMode, PrimaryWindow, WindowMode,
    WindowResolution,
};

fn desktop_window(mut windows: Query<&mut Window, With<PrimaryWindow>>) {
    for mut window in &mut windows {
        window.mode = WindowMode::Windowed;
        window.resolution = WindowResolution::new(1920, 1080);
        window.title = "Desktop".to_string();
        window.present_mode = PresentMode::AutoVsync;
    }
}

fn unlock_framerate(mut windows: Query<&mut Window, With<PrimaryWindow>>) {
    for mut window in &mut windows {
        window.present_mode = PresentMode::AutoNoVsync;
    }
}

The rest: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/HEAD/skills/bevy-adapt-mobile-to-desktop/SKILL.md
