Pyxift

main

Pyxel-style retro 2D game engine for Swift (C++ core, SDL3 backend, Linux/macOS)
atsuki-seo/Pyxift

Pyxift

Pyxift /pɪkswɪft/ — Pyxel + Swift.

A Pyxel-style retro 2D game engine (written in Swift, with a C++ core and SDL3 backend). Targets Linux and macOS.

Getting Started

Install SDL3 first, then run swift build.

macOS:

brew install sdl3

Linux (Debian/Ubuntu):

sudo apt install libsdl3-dev

If libsdl3-dev is not available, build from source via the official SDL releases:

git clone --depth 1 --branch release-3.2.x https://github.com/libsdl-org/SDL.git
cmake -S SDL -B SDL/build -DCMAKE_BUILD_TYPE=Release
cmake --build SDL/build -j
sudo cmake --install SDL/build
sudo ldconfig

Try the bundled sample

Clone the repository and run the included demo:

git clone https://github.com/atsuki-seo/Pyxift.git
cd Pyxift
swift run PyxiftDemo

Use as an SPM dependency

To use Pyxift from your own Swift package, add it as a dependency in Package.swift:

// swift-tools-version: 6.0
import PackageDescription

let package = Package(
    name: "MyGame",
    platforms: [.macOS(.v13)],
    dependencies: [
        .package(url: "https://github.com/atsuki-seo/Pyxift.git", from: "0.1.0"),
    ],
    targets: [
        .executableTarget(
            name: "MyGame",
            dependencies: [.product(name: "Pyxift", package: "Pyxift")],
            swiftSettings: [.swiftLanguageMode(.v6)]
        ),
    ]
)

A minimal game:

import Pyxift

struct MyApp: App {
    mutating func update() {}

    func draw() {
        Pyx.cls(color: .black)
        Pyx.text(x: 40, y: 56, "Hello, Pyxift!", color: .white)
    }
}

@main
struct Main {
    static func main() {
        Pyx.run(MyApp(), width: 160, height: 120, title: "My Game")
    }
}

Launch it with swift run.

License

MIT License. See LICENSE for details.

Pyxift adopts numeric specifications, the default palette, and built-in font data from Pyxel (MIT License, Copyright (c) 2018-2026 Takashi Kitao). Each file containing such adopted material carries an attribution comment at its top.

Documentation

Description

  • Swift Tools 6.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Jul 13 2026 14:27:18 GMT-0900 (Hawaii-Aleutian Daylight Time)