Latest version: 1.0.7
Swifty bindings for BearLibTerminal.
This repo is compatible with the Swift package manager. It has not yet been tested with Carthage or Cocoapods.
let terminal = BLTerminal.main terminal.open() terminal.print(point: BLPoint(x: 0, y: 0), string: "[color=red]Hi![/color]") terminal.waitForExit() terminal.close()
You need to add a new dependency to your
// swift-tools-version:4.0 import PackageDescription let package = Package( name: "My Game", dependencies: [ .package(url: "https://github.com/irskep/BearLibTerminal-Swift.git", from: "1.0.5"), ], targets: [ .target( name: "My Game", dependencies: ["BearLibTerminal"]), ] )
Why it’s better than using the C bridge directly
The C library plays fast and loose with signedness of ints. You need to convert an
UInt8 pretty regularly, and it can be hard to remember where and how to do this.
Also, If you code against the interface, you can write tests for your code without showing a GUI.
If you’re reading this from GitHub, please visit the full documentation.
If you would like more documentation, please open a GitHub issue so I know someone cares!