raylib_dartified_web 6.0.0 copy "raylib_dartified_web: ^6.0.0" to clipboard
raylib_dartified_web: ^6.0.0 copied to clipboard

Raylib for the web. WASM backend powered by Emscripten.

example/main.dart

// Draws a semi-transparent circle that follows the cursor, with live coordinates
// displayed at the center of the screen. Demonstrates window setup, the render
// loop, mouse input, text measurement, and basic drawing via the D-layer API.
import 'package:raylib_dartified_web/abbr/dart.dart';

void main() => Raylib((rl) {
  final width = 800, height = 450;

  InitWindow(width, height, 'pub.dev example');

  rl.setMainLoop(() {
    BeginDrawing();

      ClearBackground(.BLACK);

      final mouse = GetMousePosition();

      final text = '$mouse'; // Vector2D(x: <x>, y: <y>)
      final textWidth = MeasureText(text, 32);
      DrawText(text, width / 2 - (textWidth / 2), height / 2, 32, .WHITE);

      DrawCircleV(mouse, 32, Fade(.RED, .5));

    EndDrawing();
  });
});
0
likes
90
points
174
downloads

Documentation

API reference

Publisher

verified publisherxyzt.cz

Weekly Downloads

Raylib for the web. WASM backend powered by Emscripten.

Repository (GitHub)
View/report issues

License

Zlib (license)

Dependencies

args, meta, path, raylib_dartified_base

More

Packages that depend on raylib_dartified_web