stagexl_chess_pieces 1.0.0 copy "stagexl_chess_pieces: ^1.0.0" to clipboard
stagexl_chess_pieces: ^1.0.0 copied to clipboard

outdated

A package for StageXL that lets developers add high quality vector chess pieces to their project.

example/main.dart

import 'dart:async';
import 'dart:html' as html;
import 'package:stagexl/stagexl.dart';
import 'package:stagexl_chess_pieces/stagexl_chess_pieces.dart';

Stage stage;

Future<Null> main() async {
  StageOptions options = StageOptions()
    ..backgroundColor = Color.White
    ..renderEngine = RenderEngine.WebGL;

  var canvas = html.querySelector('#stage');
  stage = Stage(canvas, width: 1280, height: 800, options: options);

  var renderLoop = RenderLoop();
  renderLoop.addStage(stage);

  num size = stage.stageWidth / 6;

  stage.addChild(BlackKing()
    ..x = 0
    ..y = 0
    ..width = size
    ..height = size);

    stage.addChild(BlackQueen()
    ..x = size
    ..y = 0
    ..width = size
    ..height = size);

    
  stage.addChild(BlackBishop()
    ..x = 2 * size
    ..y = 0
    ..width = size
    ..height = size);

    stage.addChild(BlackKnight()
    ..x = 3 * size
    ..y = 0
    ..width = size
    ..height = size);

      stage.addChild(BlackRook()
    ..x = 4 * size
    ..y = 0
    ..width = size
    ..height = size);

    stage.addChild(BlackPawn()
    ..x = 5 * size
    ..y = 0
    ..width = size
    ..height = size);

    
  stage.addChild(WhiteKing()
    ..x = 0
    ..y = size
    ..width = size
    ..height = size);

    stage.addChild(WhiteQueen()
    ..x = size
    ..y = size
    ..width = size
    ..height = size);

    
  stage.addChild(WhiteBishop()
    ..x = 2 * size
    ..y = size
    ..width = size
    ..height = size);

    stage.addChild(WhiteKnight()
    ..x = 3 * size
    ..y = size
    ..width = size
    ..height = size);

      stage.addChild(WhiteRook()
    ..x = 4 * size
    ..y = size
    ..width = size
    ..height = size);

    stage.addChild(WhitePawn()
    ..x = 5 * size
    ..y = size
    ..width = size
    ..height = size);
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A package for StageXL that lets developers add high quality vector chess pieces to their project.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

stagexl

More

Packages that depend on stagexl_chess_pieces