dartgame 1.0.1 copy "dartgame: ^1.0.1" to clipboard
dartgame: ^1.0.1 copied to clipboard

A pygame inspired library.

example/example.dart

import 'package:dartgame/dartgame.dart' as dartgame;

void main(List<String> arguments) {
  final window = dartgame.Window("Hello world", 640, 480);
  final surface = dartgame.Surface.fromFile("lib/test.bmp");
  final clock = dartgame.Clock();

  bool running = true;
  dartgame.Event? event;

  while (running) {
    while ((event = window.pollEvent()) is dartgame.Event) {
      switch (event!.type) {
        case dartgame.EventType.quit:
          running = false;
          break;
      }
    }

    window.blit(surface, 0, 0, 640, 480, 0, 0, 256, 256);
    window.flip();
    clock.tick(0);
  }

  window.destroy();
  surface.destroy();
}
2
likes
135
points
12
downloads

Publisher

unverified uploader

Weekly Downloads

A pygame inspired library.

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

ffi, sdl2

More

Packages that depend on dartgame