stagexl_chess_pieces 1.0.1

StageXL Vector Chess Pieces #

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

alt text

Example #

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

CREDITS #

This project is using the SVG definitions of Chess pieces from a Wikimedia Commons page

The SVG files were converted into AS3 drawing commands using Miller Medeiros (http://www.millermedeiros.com) SVG To Motifs Parser

1.0.0 - 10/02/2018. #

  • Some little formatting changes

1.0.0 - 06/02/2018. #

  • Initial version

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);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  stagexl_chess_pieces: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:stagexl_chess_pieces/stagexl_chess_pieces.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
14
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
99
Overall:
Weighted score of the above. [more]
57
Learn more about scoring.

We analyzed this package on Feb 14, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health issues and suggestions

Document public APIs. (-1 points)

25 out of 25 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance suggestions

Package is getting outdated. (-1.10 points)

The package was last published 52 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
stagexl ^1.1.0 1.4.3
Transitive dependencies
charcode 1.1.3
collection 1.14.12
convert 2.1.1
meta 1.1.8
petitparser 3.0.1
typed_data 1.1.6
xml 3.7.0