Giter Club home page Giter Club logo

stagexl_isometric's People

Contributors

bp74 avatar jonasmaeder avatar nilsdoehring avatar thenetbird avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stagexl_isometric's Issues

Sorting IsoScene children for display

I'm having issues with the display order of children of IsoScene. Unfortunately it only seems to be able to display with the last child added being the top most displayed. For example,

library example01;

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

void main() {

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

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

  var app = new IsoApplication2();
  app.x = 400;
  app.y = 200;
  stage.addChild(app);

}

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

    var box2 = new IsoBox();
    box2.setSize(25, 25, 25);
    box2.moveTo(-40, -40, -1);

    var box3 = new IsoBox();
    box3.setSize(25, 25, 25);
    box3.moveTo(40, 40, 1);

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

    var scene = new IsoScene();
    scene.hostContainer = this;
    scene.addChild(grid);
    scene.addChild(box);
    scene.addChild(box2);
    scene.addChild(box3);
    scene.layoutEnabled = true;
    scene.isoRender();
  }
}

You can see that the last two boxes, regardless of their actual position, are displayed on top of the first middle box. I tried "scene.layoutEnabled = true;" which according to the IsoScene documentation,

  /**
   * Flags the scene for possible layout rendering.
   * If false, child objects are sorted by the order they were added rather than by their isometric depth.
   */
  bool layoutEnabled = true;

Should by default have it already sorting each render. Perhaps sorting is not implemented yet? Or maybe I'm just missing something.

Non-Interactive IsoObject

This library needs a way to create an object that does not listen to mouse events, but is still and iso-object and can be added to the usual tree of iso objects.

For now I'm using Bitmap objects that attached outside the normal structure, which works, but a this change would be much cleaner.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.