stagexl 2.3.1 copy "stagexl: ^2.3.1" to clipboard
stagexl: ^2.3.1 copied to clipboard

Platformweb

A fast and universal 2D rendering engine for HTML5 and Dart.

example/main.dart

import 'dart:math' as math;

import 'package:stagexl/stagexl.dart';
import 'package:web/web.dart' as web;

void main() {
  final options = StageOptions()
    ..stageAlign = StageAlign.TOP_LEFT
    ..stageScaleMode = StageScaleMode.NO_SCALE
    ..renderEngine = RenderEngine.WebGL;

  final canvas = web.document.querySelector('#stage') as web.HTMLCanvasElement;
  final stage = Stage(canvas, width: 990, height: 620, options: options);
  final renderLoop = RenderLoop();
  renderLoop.addStage(stage);

  final bitmapData = BitmapData(100, 100, Color.Red);
  final bitmap = Bitmap(bitmapData);
  bitmap.x = 100;
  bitmap.y = 100;
  bitmap.rotation = math.pi / 4;
  stage.addChild(bitmap);
}
38
likes
135
points
862
downloads

Publisher

unverified uploader

Weekly Downloads

A fast and universal 2D rendering engine for HTML5 and Dart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

http, web, xml

More

Packages that depend on stagexl