Public virtual function is not an expected function definition in HaXe. Researching results...
Tuesday, April 24, 2012
Flixel HaXe + NME FlxSprite Loading in iPad
AS3 embed style uses custom class ddeclarations and the Assets getbitmapdata for cross compatability:
class TestClass extends Bitmap
{
public function new() { super(Assets.getBitmapData("assets/map/ArmyGrid.png")); }
}
class GenericGrid
{
public static var Test:Class<Bitmap> = TestClass;
public function new()
{
t = new FlxSprite(0, 215, Test);
t.x = FlxG.width / 2 - t.width / 2;
t.updateTileSheet();
parentState.add(t);
OR!
Loadgraphic seems to work also on direct names on ipad so far:
/* test: succeeded, this works
t = new FlxSprite(0, 0);
t.loadGraphic("assets/map/ArmyGrid.png", false, false);
t.updateTileSheet();
t.x = FlxG.width / 2 - t.width / 2;
t.y += 200;
parentState.add(t);
*/
Note: Using Haxe + NME and FlixelHaxe from BeebleRox
class TestClass extends Bitmap
{
public function new() { super(Assets.getBitmapData("assets/map/ArmyGrid.png")); }
}
class GenericGrid
{
public static var Test:Class<Bitmap> = TestClass;
public function new()
{
t = new FlxSprite(0, 215, Test);
t.x = FlxG.width / 2 - t.width / 2;
t.updateTileSheet();
parentState.add(t);
OR!
Loadgraphic seems to work also on direct names on ipad so far:
/* test: succeeded, this works
t = new FlxSprite(0, 0);
t.loadGraphic("assets/map/ArmyGrid.png", false, false);
t.updateTileSheet();
t.x = FlxG.width / 2 - t.width / 2;
t.y += 200;
parentState.add(t);
*/
Note: Using Haxe + NME and FlixelHaxe from BeebleRox
Monday, April 23, 2012
Running Haxer the AS3 to HaXe Converter in Java
Go into src and compile with Javac -d . net/interaxia/haxer/Haxer.java
Then run java net.interaxia.haxer.Haxer:
java net.interaxia.haxer.Haxer "/Users/beastadmin/Documents/Backup/src" "/Users/beastadmin/Documents/Atmospherian-Haxer-455fc86/src/convert/"
I got an error that traced back to reading the package name to save the files so I changed that and recompiled:
Exception in thread "main" java.lang.NullPointerException
at net.interaxia.haxer.Haxer.saveOutputFile(Haxer.java:49)
at net.interaxia.haxer.Haxer.main(Haxer.java:41)
//Line 48 below...
private static void saveOutputFile(String rootFolder, HaxeFile file) {
String destinationPath = rootFolder; //Change here @ Line 49 to this
//...
}
//...
Resources:
Some Java compilation discussion in regards to Haxer that sort of helped:
http://forums.devx.com/showthread.php?t=27494
The Haxer source code:
https://github.com/Atmospherian/Haxer/blob/master/src/net/interaxia/haxer/Haxer.java
The AS3tohaxe source code: (but I didn't have time to install Haskell environment)
https://github.com/geekrelief/as3tohaxe
Then run java net.interaxia.haxer.Haxer:
java net.interaxia.haxer.Haxer "/Users/beastadmin/Documents/Backup/src" "/Users/beastadmin/Documents/Atmospherian-Haxer-455fc86/src/convert/"
I got an error that traced back to reading the package name to save the files so I changed that and recompiled:
Exception in thread "main" java.lang.NullPointerException
at net.interaxia.haxer.Haxer.saveOutputFile(Haxer.java:49)
at net.interaxia.haxer.Haxer.main(Haxer.java:41)
//Line 48 below...
private static void saveOutputFile(String rootFolder, HaxeFile file) {
String destinationPath = rootFolder; //Change here @ Line 49 to this
//...
}
//...
Resources:
Some Java compilation discussion in regards to Haxer that sort of helped:
http://forums.devx.com/showthread.php?t=27494
The Haxer source code:
https://github.com/Atmospherian/Haxer/blob/master/src/net/interaxia/haxer/Haxer.java
The AS3tohaxe source code: (but I didn't have time to install Haskell environment)
https://github.com/geekrelief/as3tohaxe
Sunday, April 22, 2012
IPad Landscape Orientation on HaXe NME
When using landscape orientation in the nmml file for an nme project targetting iPad there is a problem where lib.current.stage.stageheight and stagewidth are still referring to portrait coordinates.
To fix this add an if statement to swap the two values before you use them.
Resources:
Some usage of screeRotated and Lib.current.stage dealing with iOS landscape mode in HaXe+NME:
http://www.haxenme.org/community/forums/programming-with-haxe/how-do-we-create-a-landscape-app-in-ios/
XCode discussion forum regarding native documentation of iOS landscape mode:
http://forums.macrumors.com/showthread.php?t=548780
Thread discussing NME ios target and overriding the stage.shouldRotateInterface function for proper landscape handling:
http://markmail.org/message/agch7dhnsdyn4soz
Automatic scaling in NME for custom transition between iPad and iPhone:
http://www.haxenme.org/community/forums/programming-with-haxe/auto-scaling-between-ipad-and-iphoneipod-devices/
Talk from the NME author in a thread: "It seems that if you target iOS 3.2, you can submit with armv6, but if you target iOS 4 or 5 (not sure about 4... definitely 5) the App Store will reject your application if it lacks armv7."
http://www.haxenme.org/community/forums/bugs/keyboard-orientation/?ccm_paging_p=2
Thread containing information regarding GM2D HaXe game engine library and how it handles iOS landscape mode:
http://haxe.org/forum/thread/3395#nabble-td6459323
Discussion of landscape mode debugging with Haxe+NME on Android:
http://haxe.org/forum/thread/3395#nabble-td6685716
To fix this add an if statement to swap the two values before you use them.
Resources:
Some usage of screeRotated and Lib.current.stage dealing with iOS landscape mode in HaXe+NME:
http://www.haxenme.org/community/forums/programming-with-haxe/how-do-we-create-a-landscape-app-in-ios/
XCode discussion forum regarding native documentation of iOS landscape mode:
http://forums.macrumors.com/showthread.php?t=548780
Thread discussing NME ios target and overriding the stage.shouldRotateInterface function for proper landscape handling:
http://markmail.org/message/agch7dhnsdyn4soz
Automatic scaling in NME for custom transition between iPad and iPhone:
http://www.haxenme.org/community/forums/programming-with-haxe/auto-scaling-between-ipad-and-iphoneipod-devices/
Talk from the NME author in a thread: "It seems that if you target iOS 3.2, you can submit with armv6, but if you target iOS 4 or 5 (not sure about 4... definitely 5) the App Store will reject your application if it lacks armv7."
http://www.haxenme.org/community/forums/bugs/keyboard-orientation/?ccm_paging_p=2
Thread containing information regarding GM2D HaXe game engine library and how it handles iOS landscape mode:
http://haxe.org/forum/thread/3395#nabble-td6459323
Discussion of landscape mode debugging with Haxe+NME on Android:
http://haxe.org/forum/thread/3395#nabble-td6685716
Saturday, April 21, 2012
HaXe NME FlxTilemapExt Usage in Beebles HaxeFlixel Port
This bit of knowledge was not available on Google but to use the sloped tiles in Flixel ported to HaXe (+NME) then for some insane reason you have to call something that's seems fairly default.
The function setSlopes has to be called on the flxtilemapext after creation with four arrays as inputs. I used [2],[3],[4],[5] as my first guess and everything seams alright thus far.
This should save anyone else some time who is attempting cross-platform Flixel games.
The function setSlopes has to be called on the flxtilemapext after creation with four arrays as inputs. I used [2],[3],[4],[5] as my first guess and everything seams alright thus far.
This should save anyone else some time who is attempting cross-platform Flixel games.
Subscribe to:
Posts (Atom)