compass 0.0.5

  • README.md
  • Installing
  • Versions
  • 32

Introduction

A 2D rendering engine that uses WebGL

Features

  • WebGL renderer
  • Super easy to use API
  • Support for texture atlases
  • Asset loader / sprite sheet loade
  • Mouse interaction
  • Keyboard state

Installing via Pub

[Using http://pub.dartlang.org/packages/compass](http://pub.dartlang.org/packages/compass)

dependencies:
  compass: any

Usage


void main() {
  CanvasElement canvas = query('#container');
  
  Director.init(canvas);
  director.background = Color.parse(Color.Green);
  director.replace(new SimpleTest());
}

class SimpleTest extends Scene {
  enter() {
    var rng = new Random();
    for(var i = 0; i < 10000; i++) {
      var sprite = new Sprite();
      sprite.fill = Color.random();
      sprite.width = rng.nextDouble() * 50;
      sprite.height = rng.nextDouble() * 50;
      sprite.x = rng.nextDouble() * director.width;
      sprite.y = rng.nextDouble() * director.height;
      addChild(sprite);
    }
  }
}
    

Thanks

About

Use this package as a library

1. Depend on it

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


dependencies:
  compass: "^0.0.5"

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:compass/compass.dart';
  
Version Uploaded Documentation Archive
0.0.5 Jul 19, 2013 Go to the documentation of compass 0.0.5 Download compass 0.0.5 archive
0.0.4 Jul 17, 2013 Go to the documentation of compass 0.0.4 Download compass 0.0.4 archive
0.0.3 Jul 14, 2013 Go to the documentation of compass 0.0.3 Download compass 0.0.3 archive
0.0.2 Jul 12, 2013 Go to the documentation of compass 0.0.2 Download compass 0.0.2 archive
0.0.1 Jul 12, 2013 Go to the documentation of compass 0.0.1 Download compass 0.0.1 archive

Analysis

We analyzed this package on Jul 17, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
10 / 100
Health:
Code health derived from static analysis. [more]
89 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0 / 100
Overall score:
Weighted score of the above. [more]
32
Learn more about scoring.

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Error(s) in lib/compass.dart: Target of URI doesn't exist: 'dart:json'.

Suggestions

  • Fix platform conflicts.

    Error(s) prevent platform classification:

    Error(s) in lib/compass.dart: Target of URI doesn't exist: 'dart:json'.

  • Running dartdoc failed.

    Make sure dartdoc runs without any issues.

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Use constrained dependencies.

    The pubspec.yaml contains 3 dependencies without version constraints. Specify version ranges for the following dependencies: browser, stats, vector_math.

  • Package is too old.

    The package was released more than two years ago.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 5 errors 53 hints.

    Make sure that the imported libraries are not in conflict. Error(s) in lib/compass.dart: Target of URI doesn't exist: 'dart:json'.

    Strong-mode analysis of lib/src/geom/vector.dart failed with the following error:

    line: 31 col: 3
    Invalid override. The type of 'Vector.==' ('(Vector) → bool') isn't a subtype of 'Object.==' ('(dynamic) → bool').

    Similar analysis of the following files failed:

    • lib/src/renderer/renderer.dart (error)
    • lib/src/animation/animatable.dart (hint)
    • lib/src/animation/juggler.dart (hint)
    • lib/src/director.dart (hint)
    • lib/src/display/displayobject.dart (hint)
    • lib/src/display/interactiveobject.dart (hint)
    • lib/src/display/layer.dart (hint)
    • lib/src/display/scene.dart (hint)
    • lib/src/display/sprite.dart (hint)
    • lib/src/display/spritesheet.dart (hint)
    • lib/src/event/eventdispatcher.dart (hint)
    • lib/src/event/events.dart (hint)
    • lib/src/event/eventsubscription.dart (hint)
    • lib/src/fill/color.dart (hint)
    • lib/src/fill/fill.dart (hint)
    • lib/src/fill/image.dart (hint)
    • lib/src/fill/textureatlas.dart (hint)
    • lib/src/fill/textureatlasframe.dart (hint)
    • lib/src/geom/circle.dart (hint)
    • lib/src/geom/point.dart (hint)
    • lib/src/geom/rectangle.dart (hint)
    • lib/src/interactionmanager.dart (hint)
    • lib/src/keyboard.dart (hint)
    • lib/src/renderer/renderbatch.dart (hint)
    • lib/src/resource/resource.dart (hint)
    • lib/src/resource/resourcemanager.dart (hint)
    • lib/src/state.dart (hint)
  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use compass.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
browser any 0.10.0+3
stats any 0.1.2
vector_math any 2.0.7
Transitive dependencies
matcher 0.10.1+1 0.12.3+1
mock 0.10.0+1 0.12.0
path 1.6.1
stack_trace 0.9.3+2 1.9.2
unittest 0.10.1+2 0.12.4+1