hypersurge / awe6

awe6, the inverted game framework (Haxe)
http://awe6.org
MIT License
79 stars 11 forks source link

Compile error in Awe6 default project #23

Closed Micha0 closed 8 years ago

Micha0 commented 9 years ago

After I was successfully able to run several HaxeFlixel demos, I decided to give awe6 a go. Because, you know, TNBT and all.. I followed the installation instructions for mac:

$ haxelib install awe6

Check if it got installed:

$ haxelib run awe6
Syntax:
   to create a new project
     haxelib run awe6 create project swf|openfl|createjs <name> <package> <author>
   to create scenes or entities
     haxelib run awe6 create scene|entity <name> <package> <author>

Neat. Creating a project:

$ haxelib run awe6 create project openfl awetest awepack Micha0
Complete: Project awetest successfully created.

Nice. So, without any modification I try to run the project, but I get compile errors:

$ cd awetest/
$ haxelib run openfl test awetest.xml neko 
/usr/lib/haxelib/awe6/2,5,732/awe6/extras/gui/Text.hx:155: characters 3-36 : Float should be Null<Int>
/usr/lib/haxelib/awe6/2,5,732/awe6/extras/gui/Text.hx:155: characters 3-36 : Float should be Int

I get the exact same error with the hcpp target. But when I try the flash target everything seems to work as expected. Am I missing something? An Awe6/OpenFL project should run on all OpenFL supported platforms, right?

Thanks!

hypersurge commented 9 years ago

Sorry for the delay. You are correct, awe6 should run on all OpenFL supported platforms.

I followed this bug to a recent issue on OpenFL: https://github.com/openfl/openfl/issues/673

OpenFL's change of TextFormat.size from Float to Int will have created this problem on awe6 (and wherever else OpenFL's TextFormat was used with Floats). Edit: I've added some comments to OpenFL's issue tracker on the topic, it's a grey topic and I wouldn't expect them to revert.

Ahead of my rolling out a minor release for awe6 to correct this, you can patch your copy of awe6.extras.gui.Text line 155 to:

_textFormat.size = Math.round( textStyle.size );

Micha0 commented 9 years ago

Thanks! Worked like a charm ;-)

hypersurge commented 8 years ago

Re-opening until fix is released to Haxelib (to prevent duplicates).

hypersurge commented 8 years ago

Fix included in latest haxelib version