SolarJS Posted April 21, 2015 Share Posted April 21, 2015 It is possible, but IFrames are not faster than doing all the stuff in one canvas. Each iFrame produces also a state change, so your game will always be slower than using no IFrames. If you still want to go this path: you can communicate between these frames via normal javascript frame communication. However, please note that there are security policies applied when using IFrames which may prevent a communication, depending how you host your files. Quote Link to comment Share on other sites More sharing options...
gigbig Posted April 21, 2015 Author Share Posted April 21, 2015 It is possible, but IFrames are not faster than doing all the stuff in one canvas. Each iFrame produces also a state change, so your game will always be slower than using no IFrames. If you still want to go this path: you can communicate between these frames via normal javascript frame communication. However, please note that there are security policies applied when using IFrames which may prevent a communication, depending how you host your files. Well, but doing everything in one canvas means to develop a single piece of software, right? What I need is a game made of different components dealing with each other and coded by different coders, so if I update one component I am updating all games (that could be more than 100), without the need to recompile everything everytime.Is there an alternative way of doing what I need? Quote Link to comment Share on other sites More sharing options...
SolarJS Posted April 21, 2015 Share Posted April 21, 2015 Sure, use simple / external JavaScript libraries & interface definition. This enables you also to separate the components from each other as long as everybody uses the defined interface. If you just want to add a top layer, for example with ads, to your games, then it might be easier to add an Iframe. Quote Link to comment Share on other sites More sharing options...
gigbig Posted April 21, 2015 Author Share Posted April 21, 2015 Interfaces are necessary, imho.Could DIVs be the right way of using components? A component in each DIV.Can they communicate by JS calls? I don't have a clue on how to do this... Quote Link to comment Share on other sites More sharing options...
gigbig Posted April 21, 2015 Author Share Posted April 21, 2015 I thought I am maybe missing the point: I don't have to put components in separate DIVs, I need a single application that loads others and renders them in the same canvas, is this possible? Same as a Flash SWF loading other SWFs to obtain assets and complete applications to run on the same stage. Quote Link to comment Share on other sites More sharing options...
b10b Posted April 22, 2015 Share Posted April 22, 2015 What about awe6? I think I have seen the site a while ago, but didn't remember about it and noone named it except you. Please tell me what you know about it. How does it interact with OpenFl? Are there native libraries for tweening? Does it handle incompatibilities with different browsers when targeting HTML5? @gigbig sorry if I'm too late - but you can ask me anything about awe6, I'll probably know the answer. In a nutshell it's just a framework (main loop, state machine, helper systems for inputs, preloader and sounds), but it hopes to encourage Solid code. For HTML5 the rendering is done either by OpenFL or CreateJS (as preferred by the developer). I prefer CreateJS for the base because it's less JS to load and, in my opinion, is the more mature library. I then tend to manipulate Canvas directly for advanced rendering engines (e.g. 3D, particles, etc) or use WebGL libraries. Additionally the awe6 CreateJS driver includes some workarounds for common browser incompatibilities and has helpers for fullscreen modes, orientations, etc. Main advantage over Haxeflixel or Haxepunk is it doesn't need OpenFL or any flash package legacy (same applies for Flambe) so can be easily mixed with other JS libraries. Main disadvantage is that it's not designed for beginners, so you'll need expertise already and a big-picture reason to adopt it. Quote Link to comment Share on other sites More sharing options...
totor Posted April 22, 2015 Share Posted April 22, 2015 @b10b, do you know why the haxelib version of awe6 is not it sync with the (official) googlecode page? like a few patchs behind. Quote Link to comment Share on other sites More sharing options...
b10b Posted April 22, 2015 Share Posted April 22, 2015 @totor, sorry! CreateJS and OpenFL libraries moved a fair bit in the last 3 months so we wanted to wait for a stable period. Edit: awe6 public project has moved from googlecode to github (and received some TLC) with an updated haxelib release. Quote Link to comment Share on other sites More sharing options...
IvanK Posted April 24, 2015 Share Posted April 24, 2015 Hi, I can recommend you my own library ivank.js ( http://lib.ivank.net ), which I made for myself in order to rewrite my AS3 games into Web with minimum effort. You don't have to know any HTML, CSS or DOM. And there are some extra features, which are not present in flash (e.g. Graphics.drawTriangles3D()). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.