flixel icon indicating copy to clipboard operation
flixel copied to clipboard

HTML5, loads, but displays nothing

Open PixelTom opened this issue 12 years ago • 12 comments

I'm new to Flixel, and to OpenFL, and Haxe..

I'm just taking it one step at a time. Load an image in.

Flash: sample1

HTML5: sample2

Any ideas? The loading bar progresses fine, and I'm running a local server from exporting straight from FlashDevelop 4.6

Other Haxe Projects unrelated to Flixel load fine. But loading a single image here in Flixel? Nope.

Here's the code to load it in

var player = new FlxSprite(); player.loadGraphic("assets/images/kenney/paddleRed.png"); player.x = player.y = 200; add(player);

PixelTom avatar Apr 08 '14 02:04 PixelTom

Sry html5 is not specified as a supported target anywhere in HaxeFlixel's documentation. Stable targets are listed in the readme, mobile/desktop c++ and flash. If you are adventurous dev branches of HaxeFlixel may give you more success with the bitfive backend. However since you are new, I would recommend something like https://github.com/aduros/flambe for a html5 Haxe engine atm.

impaler avatar Apr 08 '14 03:04 impaler

No worries, thanks for that.

Sorry about the double post, I thought I was editing, not reposting.

PixelTom avatar Apr 08 '14 03:04 PixelTom

@3rd-tom Let's get you running it on HTML5, I'd say 95% of the framework works fine with the configuration below, my current game project works 100% so far:

    1. Use Flixel dev-branch: https://github.com/HaxeFlixel/flixel Install: haxelib dev flixel "/path/to/flixel/"
    1. Use alternative HTML5 backend: https://github.com/YellowAfterlife/openfl-bitfive Install: haxelib dev openfl-bitfive "path/to/bitfive"
    1. On your Project.xml:
<haxelib name="openfl" />
<set name="html5-backend" value="openfl-bitfive" />

Done! post results :)

AndreiRegiani avatar Apr 08 '14 03:04 AndreiRegiani

Getting these 3 errors in the compiler.

result

PixelTom avatar Apr 08 '14 04:04 PixelTom

@3rd-tom Possible solutions:

  • Probably something is out-of-date, use haxelib upgrade (with sudo if on mac/linux), check if works. Post your haxelib list here.
  • When setting to the dev version, be sure to set to the root directory, not the /flixel/flixel/ sub-directory. Should look like this: "/Users/andrei/flixel".
  • Try another demo.

As @impaler said, HTML5 is not officially supported, if this target is a requirement for you, use pure OpenFL or Flambe.

AndreiRegiani avatar Apr 08 '14 05:04 AndreiRegiani

Ran the upgrade, nothing updated. I only did a fresh install of everything yesterday.

Here's my list.

haxe list

HTML5 is a necessity, as much as I hate it. So I'll look at Flambe.

Thanks for your help.

PixelTom avatar Apr 08 '14 05:04 PixelTom

Your flixel is not set to the DEV version from GitHub. It should look like this: screen shot 2014-04-08 at 1 48 30

Follow the docs: http://haxeflixel.com/documentation/install-development-flixel/

AndreiRegiani avatar Apr 08 '14 05:04 AndreiRegiani

I mean, It's totally possible to get it working, but as you said that HTML5 is your main target, then HaxeFlixel is not for you. Good luck with Flambe!

AndreiRegiani avatar Apr 08 '14 05:04 AndreiRegiani

Yeah I set it back, setting it to the Dev location was breaking everything.

list again

dev1

inside the flixel-dev folder

dev2

inside the openfl-bitfive-master folder

dev3

HTML5 isn't the main target, it's just a required target. After Android and iOS apps.

It's because clients think "HTML5" = "spun gold" when they don't actually know what the hell it means.

And considering the percentage of people who use mobile browsers compared to mobile apps, I should just give HTML5 the complete flick, but I'm not the one paying the bills.

PixelTom avatar Apr 08 '14 05:04 PixelTom

I got it working

You said to change this in my XML

haxelib name="openfl" set name="html5-backend" value="openfl-bitfive"

It was actually supposed to be

set name="html5-backend" value="openfl-bitfive" haxelib name="openfl"

lol

I just happened upon this blog article http://www.openfl.org/blog/2014/03/18/flash-and-html5/ that was talking about a similar change to the backend value, and it said make sure you do it first.

So I figured "huh.. what the hell?"

And boom, worked.

And since HTML5 is secondary to other platforms, I think I'm going to stick with Flixel. Since it looks like it's heading in the right direction for HTML5 support

Thanks for your help.

PixelTom avatar Apr 08 '14 06:04 PixelTom

When copy & pasting I didn't see the order, sorry about that. If I was you, I'd test all features you gonna need, run the demos, etc, for a commercial project, for a client, I wouldn't use HaxeFlixel and promise HTML5, seriously.

Sent from my iPhone

On Apr 8, 2014, at 2:28 AM, Thomas Gattenhof [email protected] wrote:

I got it working

You said to change this in my XML

It was actually supposed to be

I just happened upon this blog article http://www.openfl.org/blog/2014/03/18/flash-and-html5/ that was talking about a similar change to the backend value, and it said make sure you do it first.

So I figured "huh.. what the hell?"

And boom, worked.

And since HTML5 is secondary to other platforms, I think I'm going to stick with Flixel. Since it looks like it's heading in the right direction for HTML5 support

Thanks for your help.

— Reply to this email directly or view it on GitHub.

AndreiRegiani avatar Apr 08 '14 06:04 AndreiRegiani

No. You're right. But I'll keep an eye on flixel developments for html5 support and just use it experimentally for now.

PixelTom avatar Apr 08 '14 06:04 PixelTom