stagexl_isometric 0.2.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 39

StageXL_Isometric #

An isometric graphics extension for StageXL.

This is work in progress...

NOTE: as of version 0.2.0-dev, StageXL_Isometric requires a Dart 2 SDK.

Change Log #

This file contains highlights of what changes on each version of the StageXL_Isometric package. This file is normally updated whenever we push a new version to pub.

Pub version 0.2.1 #

  • Raised dependency to StageXL 1.4.1
  • Ready for Dart 2.4

Pub version 0.2.0 #

  • Raised dependency to StageXL 1.4.0
  • Raised dependency to Dart 2.0 stable

Pub version 0.2.0-dev #

  • Raised dependency to StageXL 1.3.2-dev
  • Ready for Dart 2.0

Pub version 0.1.2 #

  • Added support for strong mode
  • Raised dependency to Dart SDK 1.22.0 (reason: covariant keyword)

example/example.dart

library example01;

import 'dart:html' as html;
import 'package:stagexl/stagexl.dart';
import 'package:stagexl_isometric/stagexl_isometric.dart';

void main() {
  StageXL.stageOptions.renderEngine = RenderEngine.Canvas2D;
  StageXL.stageOptions.backgroundColor = Color.AntiqueWhite;

  var canvas = html.querySelector('#stage');
  var stage = Stage(canvas);
  var renderLoop = RenderLoop();
  renderLoop.addStage(stage);

  var background = Bitmap(BitmapData(800, 600, 0x869ca7));
  stage.addChild(background);

  //var app = new IsoApplication1();
  //var app = new IsoApplication2();
  var app = IsoApplication3();
  app.x = 400;
  app.y = 200;
  stage.addChild(app);
}

class IsoApplication1 extends Sprite {
  IsoApplication1() {
    var box = IsoBox();
    box.setSize(25, 25, 25);
    box.moveTo(0, 0, 0);

    var grid = IsoGrid();
    grid.showOrigin = true;
    grid.setGridSize(10, 10);
    grid.moveTo(0, 0, 0);

    var scene = IsoScene();
    scene.hostContainer = this;
    scene.addChild(box);
    scene.addChild(grid);
    scene.isoRender();
  }
}

class IsoApplication2 extends Sprite {
  IsoApplication2() {
    var box = IsoBox();
    box.styleType = RenderStyleType.SHADED;
    box.fills = [
      SolidColorFill(0xff0000, .5),
      SolidColorFill(0x00ff00, .5),
      SolidColorFill(0x0000ff, .5),
      SolidColorFill(0xff0000, .5),
      SolidColorFill(0x00ff00, .5),
      SolidColorFill(0x0000ff, .5)
    ];
    box.setSize(25, 50, 40);
    box.moveTo(0, 0, 0);

    var grid = IsoGrid();
    grid.showOrigin = true;
    grid.setGridSize(10, 10);
    grid.moveTo(0, 0, 0);

    var scene = IsoScene();
    scene.hostContainer = this;
    scene.addChild(grid);
    scene.addChild(box);
    scene.isoRender();
  }
}

class IsoApplication3 extends Sprite {
  IsoApplication3() {
    var box = IsoBox();
    box.setSize(25, 25, 25);
    box.fills = [
      SolidColorFill(0xff00ff, 1),
      SolidColorFill(0xff00ff, 1),
      SolidColorFill(0xff00ff, 1),
      SolidColorFill(0xff00ff, 1),
      SolidColorFill(0xff00ff, 1),
      SolidColorFill(0xff00ff, 1)
    ];
    box.moveTo(0, 25, 0);

    var box2 = IsoBox();
    box2.setSize(25, 25, 25);
    box2.fills = [
      SolidColorFill(0xffff00, 1),
      SolidColorFill(0xffff00, 1),
      SolidColorFill(0xffff00, 1),
      SolidColorFill(0xffff00, 1),
      SolidColorFill(0xffff00, 1),
      SolidColorFill(0xffff00, 1)
    ];
    box2.moveTo(25, 25, 0);

    var box3 = IsoBox();
    box3.setSize(25, 25, 25);
    box3.moveTo(25, 0, 0);

    var grid = IsoGrid();
    grid.showOrigin = true;
    grid.setGridSize(10, 10);
    grid.moveTo(0, 0, 0);

    var scene = IsoScene();
    scene.hostContainer = this;
    scene.addChild(grid);

    scene.addChild(box2);
    scene.addChild(box);
    scene.addChild(box3);
    scene.layoutEnabled = true;
    scene.isoRender();
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  stagexl_isometric: ^0.2.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support 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_isometric/stagexl_isometric.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
73
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
84
Overall:
Weighted score of the above. [more]
39
Learn more about scoring.

We analyzed this package on Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: web

Primary library: package:stagexl_isometric/stagexl_isometric.dart with components: html.

Health suggestions

Fix lib/src/display/primitive/iso_hex_box.dart. (-3.93 points)

Analysis of lib/src/display/primitive/iso_hex_box.dart reported 8 hints, including:

line 11 col 14: Don't explicitly initialize variables to null.

line 72 col 25: DO use curly braces for all flow control structures.

line 104 col 9: DO use curly braces for all flow control structures.

line 123 col 9: DO use curly braces for all flow control structures.

line 160 col 9: DO use curly braces for all flow control structures.

Fix lib/src/graphics/bitmap_fill.dart. (-2.96 points)

Analysis of lib/src/graphics/bitmap_fill.dart reported 6 hints, including:

line 17 col 8: Don't explicitly initialize variables to null.

line 18 col 7: Don't explicitly initialize variables to null.

line 19 col 7: Don't explicitly initialize variables to null.

line 65 col 11: Don't explicitly initialize variables to null.

line 66 col 10: Don't explicitly initialize variables to null.

Fix lib/src/bounds/scene_bounds.dart. (-2.48 points)

Analysis of lib/src/bounds/scene_bounds.dart reported 5 hints:

line 127 col 9: DO use curly braces for all flow control structures.

line 129 col 9: DO use curly braces for all flow control structures.

line 131 col 9: DO use curly braces for all flow control structures.

line 133 col 9: DO use curly braces for all flow control structures.

line 135 col 9: DO use curly braces for all flow control structures.

Fix additional 21 files with analysis or formatting issues. (-21.94 points)

Additional issues in the following files:

  • lib/src/data/node.dart (5 hints)
  • lib/src/core/iso_container.dart (4 hints)
  • lib/src/display/primitive/iso_box.dart (3 hints)
  • lib/src/display/primitive/iso_rectangle.dart (3 hints)
  • lib/src/display/scene/iso_scene.dart (3 hints)
  • lib/src/display/iso_group.dart (2 hints)
  • lib/src/display/iso_sprite.dart (2 hints)
  • lib/src/display/iso_view.dart (2 hints)
  • lib/src/display/primitive/iso_polygon.dart (2 hints)
  • lib/src/display/primitive/iso_primitive.dart (2 hints)
  • lib/src/display/renderers/default_scene_layout_renderer.dart (2 hints)
  • lib/src/display/renderers/default_view_renderer.dart (2 hints)
  • lib/src/display/renderers/view_bounds_renderer.dart (2 hints)
  • lib/src/display/scene/iso_grid.dart (2 hints)
  • lib/src/display/scene/iso_hex_grid.dart (2 hints)
  • lib/src/graphics/solid_color_fill.dart (2 hints)
  • lib/src/core/iso_display_object.dart (1 hint)
  • lib/src/display/renderers/simple_scene_layout_renderer.dart (1 hint)
  • lib/src/display/scene/iso_origin.dart (1 hint)
  • lib/src/geom/transformations/dimetric_transformation.dart (1 hint)
  • lib/src/core/invalidation_base.dart (Run dartfmt to format lib/src/core/invalidation_base.dart.)

Maintenance suggestions

The package description is too short. (-16 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
stagexl >=1.4.1 <2.0.0 1.4.1
Transitive dependencies
charcode 1.1.2
collection 1.14.12
convert 2.1.1
meta 1.1.7
petitparser 2.4.0
typed_data 1.1.6
xml 3.5.0
Dev dependencies
build_runner any
build_test any
build_web_compilers any
pedantic any