You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by lizhi <sl...@qq.com> on 2016/01/21 05:29:42 UTC
flexjs game hugryhero
http://matrix3d.github.io/assets/html5/flexjsstage3d/bin/js-release/#test_hugryhero
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-game-hugryhero-tp51348.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: flexjs game hugryhero
Posted by lizhi <sl...@qq.com>.
i have remove all Embed,with loader.
and the flexjs not support xml now.
so the version use the json.
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-game-hugryhero-tp51348p51355.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: flexjs game hugryhero
Posted by yishayw <yi...@hotmail.com>.
Loosely following this discussion, I can add that Sencha have tried to work
around caching issues by encoding and storing in localStorage. This still
has issues of browser applicability and varying storage capacities though.
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-game-hugryhero-tp51348p51368.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: flexjs game hugryhero
Posted by Josh Tynjala <jo...@gmail.com>.
In my opinion, it wouldn't necessarily be considered a best practice to use
[Embed] with JavaScript output, but it could be useful in some
circumstances.
SWF, as a format, was great for distributing games because you could easily
download and pass around one file that can be deployed pretty much as-is on
various game portals. Games built on HTML/CSS/JS tend to be a little more
cumbersome because they usually involve multiple files. Technically,
though, you could put everything into a single HTML file. Scripts and
styles could be placed into the page using <script> and <style> tags.
Images, and maybe even other assets (like audio?), could be base64 encoded
and included in the same page too.
In response to Mike, here is some relevant documentation from Mozilla that
explains "data URIs", which is the proper name for what we're talking about
here.
https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs
In response to Om, browsers can start rendering an HTML page before it
fully loads. With the right organization, you could essentially build the
HTML equivalent of a preloader animation that loads quickly, allowing
something interesting to be displayed while the rest of the page loads.
I agree, though, that for many use cases, loading external assets is the
better choice. I just wanted to explain that there is a relevant use-case
for embedded files.
- Josh
On Thu, Jan 21, 2016 at 8:53 AM, OmPrakash Muppirala <bi...@gmail.com>
wrote:
> Any reason we want to embed images? It makes sense in a swf because it is
> a compact file format.
>
> For the HTML version if we stick a big base 64 image in the minified code,
> we are unnecessarily making the initial download size bigger.
>
> A better approach would be to use spritesheets when dealing with image
> data. These spritesheets should be downloaded on demand like all other
> assets.
>
> Thanks,
> Om
> On Jan 21, 2016 8:43 AM, "Alex Harui" <ah...@adobe.com> wrote:
>
> >
> >
> > On 1/21/16, 8:24 AM, "Michael Schmalle" <te...@gmail.com>
> wrote:
> >
> > >If/when you have time, could you make a JIRA that sort of outlined the
> > >process for the base64 encoding? I am good at somethings but something
> > >like
> > >this I really don't have any experience, I know the hooks in the
> compiler
> > >and such but what would actually be involved in getting the bytes to
> emit
> > >out.
> >
> > I would have to do research as well. Maybe Josh can provide more detail.
> > My concern is, if overused, embeds could make the html file really huge.
> >
> > -Alex
> >
> >
>
Re: flexjs game hugryhero
Posted by OmPrakash Muppirala <bi...@gmail.com>.
On Thu, Jan 21, 2016 at 10:32 PM, jude <fl...@gmail.com> wrote:
> Even if the initial download size is bigger it can actually load faster.
> This is because:
>
> *Fetching resources over the network is both slow and expensive: the
> download may require multiple roundtrips between the client and server,
> which delays processing and may block rendering of page content, and also
> incurs data costs for the visitor. [1]*
>
Agreed that downloading assets individually is quite costly. But Base64
encoding assets and sticking them in JS files is not a great way to solve
this problem. You loose browser based caching for assets, sharing assets
across applications from same domain, along with an increased page load
time. Also, Base64 encoded images are roughly 1.37 times the size of the
original image [1]
As I mentioned earlier, spritesheets are a much better alternative. With
spritesheets, you incur only one additional download and it is pretty easy
to use. [2]
CSS even natively supports image sprites.
>
> So using data uri's can get you a faster TOF (time of flight) page render.
> Not sure if I'm using that right but it sounds cool.
I am not quite sure what that means ;-)
> The downside is that
> if you reload the page nothing is in the cache. But then again, if you plan
> it right you should only be downloading the changed content (a small JSON
> object).
>
> I'm using data URI's in a few places and for small graphics like lines and
> boxes and it's only a few lines of content. The reason I'm doing this is to
> translate an SVG graphic into something older browsers can render, for
> example, the webkit in AIR does not render SVG (in my tests) so converting
> those to data URI allows the page to render as expected.
>
Instead, I would suggest having an external stylesheet that has the
definitions of all the base 64 encoded images and load it separately. At
least it would be cache-able then. The performance of this would be better
than embedding it in code, but comparable to the spritesheet method.
The problem I see is not with the encoding of the image as base64, but the
fact that we have to dump it in a JS or HTML file, thereby losing the
browser cacheability that a png or jpg provides.
Thanks,
Om
[1] https://en.wikipedia.org/wiki/Base64
[2]
http://www.williammalone.com/articles/create-html5-canvas-javascript-sprite-animation/
[3] http://www.w3schools.com/css/css_image_sprites.asp
>
> Google has some good info but the information shouldn't be taken as gospel.
> They are still catching up to things we are used to. For example, Angular
> JS is being rewritten from the ground up.
> [1]
> https://developers.google.com/speed/docs/insights/LeverageBrowserCaching
>
> On Thu, Jan 21, 2016 at 8:53 AM, OmPrakash Muppirala <bigosmallm@gmail.com
> >
> wrote:
>
> > Any reason we want to embed images? It makes sense in a swf because it
> is
> > a compact file format.
> >
> > For the HTML version if we stick a big base 64 image in the minified
> code,
> > we are unnecessarily making the initial download size bigger.
> >
> > A better approach would be to use spritesheets when dealing with image
> > data. These spritesheets should be downloaded on demand like all other
> > assets.
> >
> > Thanks,
> > Om
> > On Jan 21, 2016 8:43 AM, "Alex Harui" <ah...@adobe.com> wrote:
> >
> > >
> > >
> > > On 1/21/16, 8:24 AM, "Michael Schmalle" <te...@gmail.com>
> > wrote:
> > >
> > > >If/when you have time, could you make a JIRA that sort of outlined the
> > > >process for the base64 encoding? I am good at somethings but something
> > > >like
> > > >this I really don't have any experience, I know the hooks in the
> > compiler
> > > >and such but what would actually be involved in getting the bytes to
> > emit
> > > >out.
> > >
> > > I would have to do research as well. Maybe Josh can provide more
> detail.
> > > My concern is, if overused, embeds could make the html file really
> huge.
> > >
> > > -Alex
> > >
> > >
> >
>
Re: flexjs game hugryhero
Posted by jude <fl...@gmail.com>.
Even if the initial download size is bigger it can actually load faster.
This is because:
*Fetching resources over the network is both slow and expensive: the
download may require multiple roundtrips between the client and server,
which delays processing and may block rendering of page content, and also
incurs data costs for the visitor. [1]*
So using data uri's can get you a faster TOF (time of flight) page render.
Not sure if I'm using that right but it sounds cool. The downside is that
if you reload the page nothing is in the cache. But then again, if you plan
it right you should only be downloading the changed content (a small JSON
object).
I'm using data URI's in a few places and for small graphics like lines and
boxes and it's only a few lines of content. The reason I'm doing this is to
translate an SVG graphic into something older browsers can render, for
example, the webkit in AIR does not render SVG (in my tests) so converting
those to data URI allows the page to render as expected.
Google has some good info but the information shouldn't be taken as gospel.
They are still catching up to things we are used to. For example, Angular
JS is being rewritten from the ground up.
[1]
https://developers.google.com/speed/docs/insights/LeverageBrowserCaching
On Thu, Jan 21, 2016 at 8:53 AM, OmPrakash Muppirala <bi...@gmail.com>
wrote:
> Any reason we want to embed images? It makes sense in a swf because it is
> a compact file format.
>
> For the HTML version if we stick a big base 64 image in the minified code,
> we are unnecessarily making the initial download size bigger.
>
> A better approach would be to use spritesheets when dealing with image
> data. These spritesheets should be downloaded on demand like all other
> assets.
>
> Thanks,
> Om
> On Jan 21, 2016 8:43 AM, "Alex Harui" <ah...@adobe.com> wrote:
>
> >
> >
> > On 1/21/16, 8:24 AM, "Michael Schmalle" <te...@gmail.com>
> wrote:
> >
> > >If/when you have time, could you make a JIRA that sort of outlined the
> > >process for the base64 encoding? I am good at somethings but something
> > >like
> > >this I really don't have any experience, I know the hooks in the
> compiler
> > >and such but what would actually be involved in getting the bytes to
> emit
> > >out.
> >
> > I would have to do research as well. Maybe Josh can provide more detail.
> > My concern is, if overused, embeds could make the html file really huge.
> >
> > -Alex
> >
> >
>
Re: flexjs game hugryhero
Posted by OmPrakash Muppirala <bi...@gmail.com>.
Any reason we want to embed images? It makes sense in a swf because it is
a compact file format.
For the HTML version if we stick a big base 64 image in the minified code,
we are unnecessarily making the initial download size bigger.
A better approach would be to use spritesheets when dealing with image
data. These spritesheets should be downloaded on demand like all other
assets.
Thanks,
Om
On Jan 21, 2016 8:43 AM, "Alex Harui" <ah...@adobe.com> wrote:
>
>
> On 1/21/16, 8:24 AM, "Michael Schmalle" <te...@gmail.com> wrote:
>
> >If/when you have time, could you make a JIRA that sort of outlined the
> >process for the base64 encoding? I am good at somethings but something
> >like
> >this I really don't have any experience, I know the hooks in the compiler
> >and such but what would actually be involved in getting the bytes to emit
> >out.
>
> I would have to do research as well. Maybe Josh can provide more detail.
> My concern is, if overused, embeds could make the html file really huge.
>
> -Alex
>
>
Re: flexjs game hugryhero
Posted by Alex Harui <ah...@adobe.com>.
On 1/21/16, 8:48 AM, "Michael Schmalle" <te...@gmail.com> wrote:
>Ok, I am ignorant. If I was to make a little audio app with FlexJS, "what"
>are the assets as far as like png loading for an image?
There is an Image component that loads png/gif/jpg.
>
>Is all that in the FlexJS stor example?
>
>How is the layout working on browsers? Last time I checked there was still
>styling and layout hicups.
Oh, I am sure there are still bugs. But we need folks like you to help us
find and fix them.
>
>Do you have an online example of the current FlexJS store app?
And older version is here:
http://people.apache.org/~aharui/FlexJS/FlexJSStore/
-Alex
Re: flexjs game hugryhero
Posted by Michael Schmalle <te...@gmail.com>.
Ok, I am ignorant. If I was to make a little audio app with FlexJS, "what"
are the assets as far as like png loading for an image?
Is all that in the FlexJS stor example?
How is the layout working on browsers? Last time I checked there was still
styling and layout hicups.
Do you have an online example of the current FlexJS store app?
Mike
On Thu, Jan 21, 2016 at 11:43 AM, Alex Harui <ah...@adobe.com> wrote:
>
>
> On 1/21/16, 8:24 AM, "Michael Schmalle" <te...@gmail.com> wrote:
>
> >If/when you have time, could you make a JIRA that sort of outlined the
> >process for the base64 encoding? I am good at somethings but something
> >like
> >this I really don't have any experience, I know the hooks in the compiler
> >and such but what would actually be involved in getting the bytes to emit
> >out.
>
> I would have to do research as well. Maybe Josh can provide more detail.
> My concern is, if overused, embeds could make the html file really huge.
>
> -Alex
>
>
Re: flexjs game hugryhero
Posted by Alex Harui <ah...@adobe.com>.
On 1/21/16, 8:24 AM, "Michael Schmalle" <te...@gmail.com> wrote:
>If/when you have time, could you make a JIRA that sort of outlined the
>process for the base64 encoding? I am good at somethings but something
>like
>this I really don't have any experience, I know the hooks in the compiler
>and such but what would actually be involved in getting the bytes to emit
>out.
I would have to do research as well. Maybe Josh can provide more detail.
My concern is, if overused, embeds could make the html file really huge.
-Alex
Re: flexjs game hugryhero
Posted by Michael Schmalle <te...@gmail.com>.
If/when you have time, could you make a JIRA that sort of outlined the
process for the base64 encoding? I am good at somethings but something like
this I really don't have any experience, I know the hooks in the compiler
and such but what would actually be involved in getting the bytes to emit
out.
If you don't have time, that is fine. I am getting interested in some audio
experiements... (WebAudio)
Mike
On Thu, Jan 21, 2016 at 11:11 AM, Alex Harui <ah...@adobe.com> wrote:
>
>
> On 1/21/16, 2:43 AM, "Michael Schmalle" <te...@gmail.com> wrote:
>
> >Oh yeah one other things to those that read. What Renaun proved was that
> >the Starling framework "could" be used and it compiled to JS, so.....
> >
> >@Alex, this is why lizhi was asking about Embed, the hungry heros
> >examples.
>
> I'm sure other folks will want embed as well, and Josh proposed a
> solution. If someone has time to work on it, please do so. It isn't high
> on my list because IMO you can live without it in most cases.
>
> -Alex
>
>
Re: flexjs game hugryhero
Posted by Alex Harui <ah...@adobe.com>.
On 1/21/16, 2:43 AM, "Michael Schmalle" <te...@gmail.com> wrote:
>Oh yeah one other things to those that read. What Renaun proved was that
>the Starling framework "could" be used and it compiled to JS, so.....
>
>@Alex, this is why lizhi was asking about Embed, the hungry heros
>examples.
I'm sure other folks will want embed as well, and Josh proposed a
solution. If someone has time to work on it, please do so. It isn't high
on my list because IMO you can live without it in most cases.
-Alex
Re: flexjs game hugryhero
Posted by Michael Schmalle <te...@gmail.com>.
Oh yeah one other things to those that read. What Renaun proved was that
the Starling framework "could" be used and it compiled to JS, so.....
@Alex, this is why lizhi was asking about Embed, the hungry heros examples.
Mike
On Thu, Jan 21, 2016 at 5:41 AM, Michael Schmalle <teotigraphixllc@gmail.com
> wrote:
> Yeah, what I meant was give people like you the ability to write against
> native JS API, so thank you for having interest in what you are doing, it
> makes all the time I spent on this compiler in 2012-2013 totally worth it.
>
> BTW, I have some things I am working on right now but I am really
> interested in this part of graphics and combining them with a web audio
> framework to make some audio apps with web audio and canvas/wegl.
>
> Keep up the great work lizhi! :)
>
> Mike
>
> On Thu, Jan 21, 2016 at 5:06 AM, lizhi <sl...@qq.com> wrote:
>
>> and if i have time,i will render the flash api,use the webgl.
>> not depend the starling.just flash api webgl.
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-flex-development.2333347.n4.nabble.com/flexjs-game-hugryhero-tp51348p51352.html
>> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>>
>
>
Re: flexjs game hugryhero
Posted by Michael Schmalle <te...@gmail.com>.
Yeah, what I meant was give people like you the ability to write against
native JS API, so thank you for having interest in what you are doing, it
makes all the time I spent on this compiler in 2012-2013 totally worth it.
BTW, I have some things I am working on right now but I am really
interested in this part of graphics and combining them with a web audio
framework to make some audio apps with web audio and canvas/wegl.
Keep up the great work lizhi! :)
Mike
On Thu, Jan 21, 2016 at 5:06 AM, lizhi <sl...@qq.com> wrote:
> and if i have time,i will render the flash api,use the webgl.
> not depend the starling.just flash api webgl.
>
>
>
> --
> View this message in context:
> http://apache-flex-development.2333347.n4.nabble.com/flexjs-game-hugryhero-tp51348p51352.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>
Re: flexjs game hugryhero
Posted by lizhi <sl...@qq.com>.
and if i have time,i will render the flash api,use the webgl.
not depend the starling.just flash api webgl.
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-game-hugryhero-tp51348p51352.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: flexjs game hugryhero
Posted by lizhi <sl...@qq.com>.
thanks your js.swc
but it is different.
this game not use the starling,and webgl.
this game use the canvas.
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-game-hugryhero-tp51348p51351.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: flexjs game hugryhero
Posted by Michael Schmalle <te...@gmail.com>.
Ha, nice Renaun did this game back with Randori compiler and it worked
great 3 years ago.
One of the main reasons I put some much time into getting externs to work
and why I wrote EXTERNC to generate the js.swc was this example right here
with webgl.
So hats off to you lizhi! You are doing a great job, I am going to have to
look at this when I get more time.
Mike
On Thu, Jan 21, 2016 at 2:22 AM, OmPrakash Muppirala <bi...@gmail.com>
wrote:
> Haha, this is freaking amazing! Its a bit buggy but it's great start.
> Nice job!
>
> Thanks,
> Om
>
> On Wed, Jan 20, 2016 at 8:29 PM, lizhi <sl...@qq.com> wrote:
>
> >
> >
> http://matrix3d.github.io/assets/html5/flexjsstage3d/bin/js-release/#test_hugryhero
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-flex-development.2333347.n4.nabble.com/flexjs-game-hugryhero-tp51348.html
> > Sent from the Apache Flex Development mailing list archive at Nabble.com.
> >
>
Re: flexjs game hugryhero
Posted by OmPrakash Muppirala <bi...@gmail.com>.
Haha, this is freaking amazing! Its a bit buggy but it's great start.
Nice job!
Thanks,
Om
On Wed, Jan 20, 2016 at 8:29 PM, lizhi <sl...@qq.com> wrote:
>
> http://matrix3d.github.io/assets/html5/flexjsstage3d/bin/js-release/#test_hugryhero
>
>
>
> --
> View this message in context:
> http://apache-flex-development.2333347.n4.nabble.com/flexjs-game-hugryhero-tp51348.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>
RE: flexjs game hugryhero
Posted by Sugan Naicker <Su...@dev-x.co.za>.
Hi,
Very nice!
Rgs
Sugan
-----Original Message-----
From: lizhi [mailto:sliz@qq.com]
Sent: Thursday, January 21, 2016 6:30 AM
To: dev@flex.apache.org
Subject: flexjs game hugryhero
http://matrix3d.github.io/assets/html5/flexjsstage3d/bin/js-release/#test_hu
gryhero
--
View this message in context:
http://apache-flex-development.2333347.n4.nabble.com/flexjs-game-hugryhero-t
p51348.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.