bp74 / stagexl_isometric Goto Github PK
View Code? Open in Web Editor NEWAn isometric graphics extension for StageXL.
License: Other
An isometric graphics extension for StageXL.
License: Other
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.