The previous post is referring to your sample code, that is, new project, paste your sample code, and it only renders the square in the flash target, the others (windows, neko and html5) only shows a black stage with no errors and crashes. I’ve tried build and run from inside haxedevelop and using openfl command line.
I don’t know if I can upload the svg file that I use, but I could try, but perhaps my problem is regardless the svg asset that I load, because I can´t even make your sample work…
I’ll problably have to reinstall everything, don’t I?
No, it is me that have to thank you, big time!
Here is the svg that I use for my own tests, but I think my problem lies elsewhere… https://we.tl/0l8YXCyhNR
I discovered a rendering discrepancy with this file, which should be fixed in the development version of OpenFL now
package;
import format.SVG;
import openfl.Assets;
import openfl.display.Shape;
import openfl.display.Sprite;
class Main extends Sprite {
public function new () {
super ();
var shape = new Shape ();
//shape.graphics.beginFill (0xFF0000);
//shape.graphics.drawRect (0, 0, 100, 100);
var svg = new SVG (Assets.getText ("assets/svg_test_asset.svg"));
svg.render (shape.graphics);
addChild (shape);
var graphicsData = shape.graphics.readGraphicsData ();
var shape2 = new Shape ();
//shape2.graphics.copyFrom (shape.graphics);
shape2.graphics.drawGraphicsData (graphicsData);
shape2.y = 200;
addChild (shape2);
}
}
If Windows and Neko are not working properly for you, can you try openfl test neko -Dcairo or openfl test html5 -Dcanvas, in case it is an OpenGL issue on your system?
Tried straight away openfl test neko -Dcairo - didn’t show the red square;
Tried openfl test html5 -Dcanvas- no red square;
Tried openfl test neko, openfl test windows, openfl test html5 - still no red square;
Tried openfl test flash - showed the red square, no issues here.
I can’t figure out what is happennig in my end, I think the only thing I’ve not tried yet is build and run on other machine. I don’t know if anyone else that is reading this, could try the following sample, with the latest OpenFL, and test the neko/windows/html5 targets and see if the red square appears normally:
package;
import openfl.display.Shape;
import openfl.display.Sprite;
class Main extends Sprite {
public function new () {
super ();
var shape = new Shape ();
shape.graphics.beginFill (0xFF0000);
shape.graphics.drawRect (0, 0, 100, 100);
var graphicsData = shape.graphics.readGraphicsData ();
var shape2 = new Shape ();
shape2.graphics.drawGraphicsData (graphicsData);
addChild (shape2);
}
}
Something is definitely wrong, I’ve tested in other machine, made a clean install of haxe and openfl (and haxe never was installed there before). Copied only the sample project without the bin folder. So new builds from scratch for all the targets, and the red square only appears in flash target, regardless I use -Dcairo in neko.
I don’t what is happening, but I starting to think that the problem couldn’t be only in my end. @singmajesty, could you please give me some advices in how I could sort this out?
And please, could other good soul try the previous sample code and see if the red square appears in other target besides flash?
Haxe installed with the official installer (v3.4.2). OpenFL installed using haxelib, then did the setup (as instructed in the openfl.org download page), and lastly made an update by haxelib when you instructed me to do so.
returns: --macro lime.Lib.extraParams() C:\HaxeToolkit\haxe\lib\lime/5,0,0/ -D lime=5.0.0
To update OpenFL, we can use the haxelib update, right? or do we have to remove everything, and install again Haxe, fetch Openfl with haxelib and run the setup?
No problem at all, we are here to make OpenFL/Haxe stronger. I think that is what a community means, and we have to thank the creators (you of course!) for bringing this great tools. I hope I could continue to grow (as a developer) along side OpenFL/Haxe and help to contribute even further. Keep up the good work ;)!