Having fun modifying the engine to get the html5 export to work.

letmethink

  • *
  • Posts: 2545
If anyone working on the toolset could give me a hand; currently when you publish to html5, it only creates a .zip of C:\Users\usernamer\AppData\Roaming\Stencyl\stencylworks\games-generated\gamename\Export\html5\bin\assets when it should create a .zip of all of: C:\Users\usernamer\AppData\Roaming\Stencyl\stencylworks\games-generated\gamename\Export\html5\bin\

This means that to publish you have to test and then create a .zip of this by hand.

_______________________________

Also, on another note, currently to build your game for web, for it to work on firefox - edit around line 52 of the file located here:

C:\Program Files (x86)\Stencyl\plaf\haxe\lib\openfl\openfl\openfl\_internal\renderer\canvas\CanvasShape.hx

to read:
Code: [Select]
                if (graphics.__bounds.width > 0 && graphics.__bounds.height > 0){       
                    if (scrollRect == null) {
                        context.drawImage (graphics.__canvas, graphics.__bounds.x, graphics.__bounds.y);
                    } else {
                        if (scrollRect.width > 0 && scrollRect.height > 0){   
                            context.drawImage (graphics.__canvas, Math.ceil (graphics.__bounds.x + scrollRect.x), Math.ceil (graphics.__bounds.y + scrollRect.y), scrollRect.width, scrollRect.height, Math.ceil (graphics.__bounds.x + scrollRect.x), Math.ceil (graphics.__bounds.y + scrollRect.y), scrollRect.width, scrollRect.height);
                        }
                    }
                }
Rather than what it is currently:
Code: [Select]
                if (scrollRect == null) {
                    context.drawImage (graphics.__canvas, graphics.__bounds.x, graphics.__bounds.y);
                } else {
                    context.drawImage (graphics.__canvas, Math.ceil (graphics.__bounds.x + scrollRect.x), Math.ceil (graphics.__bounds.y + scrollRect.y), scrollRect.width, scrollRect.height, Math.ceil (graphics.__bounds.x + scrollRect.x), Math.ceil (graphics.__bounds.y + scrollRect.y), scrollRect.width, scrollRect.height);
                }

~Letmethink

Donni11

  • *
  • Posts: 2181
Wow this is awesome :) ! Nice work :)!!!!  Just curious , does android support html5 format ?
Peace

RengadeQuarters

  • Posts: 98
I updated to the new version of stencyl is there supposed to be a new tab for exporting to html5 ?

Justin

  • *
  • Posts: 4716
[workspace]/prefs/boot.txt, html5.enabled=true
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

letmethink

  • *
  • Posts: 2545
I added in all of the filters in a new PR. They aren't particularly fast (and there is probably a better way of doing them - in fact I'm sure there is (I should work on that)).
~Letmethink

captaincomic

  • *
  • Posts: 6108
Cool! I merged your pull request.

letmethink

  • *
  • Posts: 2545
Next thing I need to do is fonts which don't display at all right now (I think this is to do with encoding).
~Letmethink

letmethink

  • *
  • Posts: 2545
I didn't have to do much with fonts, but I fixed rendering them with opacity, and I also fixed a very strange bug which was due to html5 implicitly rounding incorrectly. The latest build of my Ludum dare game in html5 is here:

http://www.newgrounds.com/projects/games/896330/preview

The next thing I am going to work in is mobile touch which isn't working right now. (I think it is due to html5 on mobile not recognising the '#if mobile' flags.
~Letmethink

rob1221

  • *
  • Posts: 9473
Quote
I think it is due to html5 on mobile not recognising the '#if mobile' flags.
I think so.  You'll see "#if !js" a few times inside Input.hx.  "#if cpp" also does not include HTML5.

letmethink

  • *
  • Posts: 2545
Quote
I think it is due to html5 on mobile not recognising the '#if mobile' flags.
I think so.  You'll see "#if !js" a few times inside Input.hx.  "#if cpp" also does not include HTML5.
I had more of a look, and mouse events won't be triggered on mobile html5, so I redirected the touch events to the mouse functions for now, just to fix it temporarily and so I can test further.
~Letmethink

RengadeQuarters

  • Posts: 98
I am Getting a error in the newest build 8585 when trying to test.

letmethink

  • *
  • Posts: 2545
Comment out lines 14 and 17 of input.hx of now (found at the location there). I'll make a new PR fixing that.
~Letmethink

Donni11

  • *
  • Posts: 2181
@letmethink , Is this fixed in  8626 ?
Peace

letmethink

  • *
  • Posts: 2545
It will be fixed when the PR is merged.
~Letmethink

Donni11

  • *
  • Posts: 2181
Peace