ToolkitForDart / darttoolkit-extension

Toolkit for Dart for Adobe Flash Professional: sources
http://toolkitfordart.github.io
32 stars 11 forks source link

StaxeXL 0.12.x incompatibility #17

Open elsassph opened 9 years ago

elsassph commented 9 years ago

StageXL 0.12 introduces API breaking changes.

The toolkit (including v0.6) is compatible with StageXL 0.11.0. You can update your pubspec.yaml file to use this specific version like this:

dependencies:
  stagexl: ^0.11.0

I'm looking to adapt the toolkit to 0.12.

bp74 commented 9 years ago

Thanks Philippe, that would be awesome! There is one important breaking change that may be important for the Toolkit. The default render engine is WebGL now, but Shapes/Graphics are still not supported with this renderer (it will be supported with the next version of StageXL).

For the time being, you can switch back the default renderer like this:

StageXL.stageOptions.renderEngine = RenderEngine.Canvas2D;
elsassph commented 9 years ago

@bp74 Ha! I was about to report that graphics were not rendering in webGL :)

That said, something's strange with Graphics and Canvas2D - but maybe I'm just rusty with StageXL. I didn't expect to have to call beginPath/closePath when drawing multiple colors (without it, the last fill color applies to all the paths).

var test = new Shape();
test.graphics.circle(100, 100, 60);
test.graphics.fillColor(Color.Red);
test.graphics.strokeColor(Color.Black, 4);
test.graphics.beginPath();
test.graphics.rect(0,0,100,100);
test.graphics.fillColor(Color.Coral);
test.graphics.strokeColor(Color.White, 4);
bp74 commented 9 years ago

Yes that's right. It's not an invention of StageXL but the behavior of the Canvas drawing API. StageXL uses just a very thin wrapper over this API.

elsassph commented 9 years ago

Do you have an idea when webGL graphics will work?

bp74 commented 9 years ago

I think i will take a few weeks. Currently i'm working on the basics and i can fill solid colors :) Next up are strokes/lines, the non-zero winding rule and after that gradients .. so still some things to do.

http://www.stagexl.org/temp/graphics_webgl/index.html

elsassph commented 9 years ago

Nice, webGL even in IE11 :)