> ## Documentation Index
> Fetch the complete documentation index at: https://docs.playtolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Windows

> Ship the Playtolia SDK in a Windows desktop build of your Unity game.

The Playtolia package supports **Windows x64 players** in addition to Android and iOS. Your game code stays the same: the same C# APIs (`PlaytoliaAuth`, `PlaytoliaSession`, `PlaytoliaSocial`, and so on) work on Windows. The same SDK UI (overlay button, sign-in sheet, menu, and all screens) appears in the game.

On Windows, the package loads a native library (`playtolia.dll`). It draws the SDK UI as a full-screen overlay on top of your game, and sends mouse and keyboard input to it.

### Requirements

* **Build target:** **Windows, x86\_64** (`StandaloneWindows64`). 32-bit Windows is not supported.
* **Input handling:** the overlay reads input through the legacy Input Manager. Set **Edit ▸ Project Settings ▸ Player ▸ Other Settings ▸ Active Input Handling** to **Input Manager (Old)** or **Both**. If you set it to **Input System Package (New)** only, the overlay cannot receive clicks or keys.

You do not need other setup. The package ships `playtolia.dll` and its runtime libraries in `Plugins/Windows/x86_64`. They are marked for Windows x64 players only.

### Build

Build your game for Windows as usual (**File ▸ Build Profiles ▸ Windows**). After the build, the package does two things automatically:

* It writes your Playtolia settings (Game ID and features) to `<Product>_Data/Playtolia/playtolia_conf.json`. The SDK reads this file at startup.
* It copies `icudtl.dat` next to the executable. The SDK UI needs this file to lay out text.

Keep these files with the build when you package or upload it. If `playtolia_conf.json` is missing, the SDK does not start and the player log shows `configuration not found`.

> [!NOTE]
>
> The native library loads only in a **Windows player build**. In Play Mode in the Unity Editor, the Windows overlay does not run. Test Windows-specific behavior in a built player.

### Startup

The `Playtolia` GameObject starts the SDK on Windows, as it does on mobile. Startup waits until the SDK is ready, so code in `Start()` can call the SDK right away. On a slow network, the SDK finishes startup in the background, and the state listeners tell you when data arrives.

The SDK writes its logs to the Unity player log, with the `[Playtolia]` prefix, at the logging level that you set in the Playtolia settings.

### Overlay and input

The overlay sits above your game. While the overlay is visible, the SDK receives all mouse and keyboard events. To keep your game from also acting on them, use `PlaytoliaDesktopOverlay` (namespace `Playtolia.Desktop`):

```c# theme={null}
using Playtolia.Desktop;
using UnityEngine;

public class PlayerInput : MonoBehaviour
{
    void Update()
    {
        // A sign-in sheet or other SDK screen has the keyboard: ignore game keys, Escape included.
        if (PlaytoliaDesktopOverlay.KeyboardCaptured) return;

        // The cursor is over the overlay button or an SDK screen: ignore game clicks.
        if (Input.GetMouseButtonDown(0) && !PlaytoliaDesktopOverlay.PointerOverUi)
        {
            Fire();
        }

        if (Input.GetKeyDown(KeyCode.Escape)) OpenPauseMenu();
    }
}
```

| Member | Type | Notes |
| - | - | - |
| `KeyboardCaptured` | `static bool` | `true` while an SDK sheet or dialog is open and has the keyboard. |
| `PointerOverUi` | `static bool` | `true` while the overlay is visible and the cursor is over an SDK element. |
| `IsSupportedPlatform` | `static bool` | `true` only in a Windows player. |
| `Instance` | `static PlaytoliaDesktopOverlay` | The running overlay. `null` if the native library did not load. |
| `Visible` | `bool` | Shows if the overlay is visible. |
| `SetVisible(visible)` | `void` | Shows or hides the overlay. A hidden overlay draws nothing and receives no input. |

For example, hide the overlay during a cutscene:

```c# theme={null}
PlaytoliaDesktopOverlay.Instance?.SetVisible(false);
// ...
PlaytoliaDesktopOverlay.Instance?.SetVisible(true);
```

#### Keyboard in the SDK UI

* **Escape** goes back one screen. On the first screen of a sheet, it closes the sheet. The button that Escape triggers shows an `ESC` hint.
* **Tab** moves the focus to the next field.
* **Enter** moves from the email field to the password field, and submits the sign-in and sign-up forms.
* **Ctrl+A, Ctrl+C, Ctrl+X, Ctrl+V** select all, copy, cut, and paste with the system clipboard.
* If the player holds **Backspace**, **Delete**, or an arrow key, the key repeats at the rate set in Windows.

> [!WARNING]
>
> The SDK UI does not support IME input yet. Players cannot type Chinese, Japanese, or Korean text through an input method editor in SDK text fields.

### Sign-in

Email and password sign-in, sign-up, and guest mode work as on mobile.

**Google** sign-in opens in the default browser of the player. When the player finishes, the browser tab shows the name and icon of your game (from the Playtolia dashboard) and tells the player to return to the game. The game is then signed in and comes back to the front. You do not need to set up anything for this.

**Apple** sign-in is not available on Windows. The SDK does not show the Apple button there.

### Stored data

The SDK keeps the session and cached data for each game in `%LOCALAPPDATA%\Playtolia\games\<Game ID>\`, so players stay signed in after they restart the game. The access and refresh tokens are encrypted with Windows DPAPI for the current Windows user. If a token cannot be decrypted (for example, the folder was copied from a different user or PC), the SDK signs the player out.

If you turn off persistence in the Playtolia settings, the SDK stores nothing on disk, and the player must sign in at each start.

### Feature support

| Feature | Windows |
| - | - |
| Authentication (email, guest, Google) | Supported |
| Apple sign-in | Not available |
| Account management, Social, Party | Supported |
| Overlay UI and support tickets | Supported |
| Wallets, entitlements, subscriptions (read) | Supported |
| Purchases | Not available yet |
| Push and local notifications | Not available (calls do nothing) |
| Review prompt (`PlaytoliaPromotion`) | Not available (calls do nothing) |
| Attribution | Not available (methods return `null`) |
| Analytics | Supported |
| macOS players | Not supported yet |

> [!NOTE]
>
> Windows has no PC store connection yet. A purchase on Windows fails with a "not available" result, so make sure that your store UI handles a failed purchase. Wallet balances and entitlements that the player got on another platform or from the server are visible on Windows.

> [card] [Authentication](https://docs.playtolia.com/for-unity/authentication.md)
>
> Sign-in providers and flows

> [card] [Overlay UI](https://docs.playtolia.com/for-unity/overlay-ui.md)
>
> Configure the overlay button and screens


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.