J-F Posted January 11, 2014 Share Posted January 11, 2014 Hey everybody,I love HTML5 especially because it runs everywhere. I've been really into Cocoon.js and it seems like that the canvas is going to be seperated more and more from the DOM. For example I found it really bugging to create a new DOM-Image-Object, that is ment to be used in the DOM, to render an image to the canvas, because properties like "align" and "border" become obsolete. Of course there are other examples like the audio tag, ... When developers of new plattforms don't have to worry about some sillinesses of the DOM, the canvas and HTML5 could get more popular and could also be hardware-accelerated.What is your opinion on this topic? Greetings, J-F Quote Link to comment Share on other sites More sharing options...
Chris Posted January 11, 2014 Share Posted January 11, 2014 My opinion is that you seem to be confused about the topic and mix up things. You cannot abstract away the DOM to make "HTML5" more popular, because the DOM is a fixed part that belongs to the whole ecosystem. The DOM is the collection of objects generated by the browser when the HTML has been interpreted and turned into objects. The DOM is the thing you can address with JavaScript to manipulate the objects that have been generated from the HTML text. You cannot abstract that away. What you do in JavaScript when you want to load an image is that you DIRECTLY create a image object by calling new Image() and then setting the properties like "src".Exactly that happens as well when you place a <img> tag in your HTML source, only that the browser "reads" the HTML text and creates objects out of that source. I hope this helps you understanding the topic a bit better. Quote Link to comment Share on other sites More sharing options...
J-F Posted January 12, 2014 Author Share Posted January 12, 2014 @ChrisThanks for your answer, but I don't think that you know what I ment. I think I understood the DOM and its functions very well and see why it is so important in a normal website. But the latest development in the JavaScript community show that there is a demand for hardware accelerated games to give the feeling of native apps on mobile plattforms. For me it could make sense to leave the website-document and give the programmer a feeling he is used to in non-web languages and frameworks. Many things in canvas are directly related to the webbrowser, although I could imagine using JavaScript without the context of a webbrowser aswell. Greetings, Jan Quote Link to comment Share on other sites More sharing options...
Ezelia Posted January 12, 2014 Share Posted January 12, 2014 there is one important thing you forget : wrappers like Cocoonjs or ejecta, drop DOM support to gain some performance because the present mobile browser implementations still have performance issues when both DOM and canvas/WebGL are rendered. also, those engines add better support to some HTML5 features that are not fully implemented on mobile browsers (take webaudio as example).when all mobile browsers will become mature and fix most of performance issues, I'll be using wrappers that give me access to DOM, since implementing GUI/HUD is mutch simpler with DOM.IMO, the power of HTML5 it that it give you both choices, you can completely drop the dom stuff and use it as a JS only framework, but you can also profit from some cool possibilities that HTML/CSS3 provide. Quote Link to comment Share on other sites More sharing options...
Chris Posted January 13, 2014 Share Posted January 13, 2014 Sooo... when you don't want to use HTML5, then why are you using it? Just write your game in objective-C and the likes to have native performance and remove all the abstraction and flexibility you criticise on HTML5 to make it "slow". Problem solved. Quote Link to comment Share on other sites More sharing options...
stevefromio Posted January 15, 2014 Share Posted January 15, 2014 That sounds great Chris, but it isn't practical. If you want to go that route as an indie developer, you would have to know Objective-C for iOS, Java for Android, and others for Windows. I have no idea what the OP is talking about, but it would be really nice to have an HTML canvas that is nothing but a direct Open-GL view to hardware. I don't get why we need different browsers to "support the canvas" in unique ways. Why can't we just have a standard for a change. Quote Link to comment Share on other sites More sharing options...
Chris Posted January 15, 2014 Share Posted January 15, 2014 There are more ways to code a game and compile it for different platforms. Afaik unity can do that perfectly. Quote Link to comment Share on other sites More sharing options...
Ezelia Posted January 15, 2014 Share Posted January 15, 2014 @stevefromio developers needs are different, what's useless for you is very important for others actually as Chris said, Unity do exactly what you are looking for, a great IDE, a short learning curve and can produce native applications for all platforms (but no HTML5 output). 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.