HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.97k stars 435 forks source link

HTML5, loads, but displays nothing #980

Closed PixelTom closed 10 years ago

PixelTom commented 10 years ago

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);

impaler commented 10 years ago

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.

PixelTom commented 10 years ago

No worries, thanks for that.

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

AndreiRegiani commented 10 years ago

@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:

<haxelib name="openfl" />
<set name="html5-backend" value="openfl-bitfive" />

Done! post results :)

PixelTom commented 10 years ago

Getting these 3 errors in the compiler.

result

AndreiRegiani commented 10 years ago

@3rd-tom Possible solutions:

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

PixelTom commented 10 years ago

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.

AndreiRegiani commented 10 years ago

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 commented 10 years ago

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!

PixelTom commented 10 years ago

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 commented 10 years ago

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.

AndreiRegiani commented 10 years ago

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 notifications@github.com 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.

PixelTom commented 10 years ago

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