Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #30978
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2016-07-26 16:26 -0700 |
| References | <5486a32e-a929-445a-98eb-1aaa2ed3dcc0@googlegroups.com> <bc67be05-cf4d-41a0-a1f8-bc33c3a22bc1@googlegroups.com> <deab174b-23e5-4b2b-b1e2-c2f773e2e473@googlegroups.com> |
| Message-ID | <6cf0589d-a169-45aa-9a2e-617ba94bb989@googlegroups.com> (permalink) |
| Subject | Re: HTML inside a CANVAS |
| From | "Michael Haufe (TNO)" <tno@thenewobjective.com> |
On Tuesday, July 26, 2016 at 12:56:43 PM UTC-5, bit-n...@hotmail.com wrote: > On Tuesday, July 26, 2016 at 12:20:37 AM UTC+5:30, Michael Haufe (TNO) wrote: > > > [1] This would be a very ambitious project to pursue. > > > What's so ambitious about it? *Every single game* ever made has implemented its own UI (like, to choose "1 player/2 player", high scores, input your name and all), to me this is far more fun than HTML and CSS (which I don't know very well), which, if you use, your site will still look the same as all other sites on the web.... > > I don't want to write a "rendering *engine*" (whatever that is), just like, display some text in a font I want, without the nightmare of HTML and CSS.... > Your original question was about rendering a form, which I assume meant rendering a functional HTML inside of the canvas tag. This would require a significant amount of effort to accomplish as the HTML spec is non-trivial. If you want some naive form, it would still be quite involved as you would still have to implement your own event listeners, your own scene graph, and a limited rendering engine to handle it. Making a UI is fine. I didn't say it was difficult, it's just... involved if you are starting from scratch and I honestly don't think you have the prerequisite knowledge to create one in any reasonable amount of time at the moment. I would of course give you an outline if desired on how to implement such a thing of course, but the labor is quite extensive if doing it from nearly first principals with little more than the CANVAS API. Hence my question, why bother when SVG and HTML is already at hand? > That Zebkit thing looks cool, yeah.... An interesting experiment for sure, but if you take a look at the implementation of TextField for example you might get an idea about what's potentially involved: <https://github.com/barmalei/zebra/blob/master/src/ui.TextField.js> There are better ways to approach this of course from an architectural level, but the amount of code to be written is still non-trivial. Your video game authors generally re-use existing work
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
HTML inside a CANVAS bit-naughty@hotmail.com - 2016-07-25 11:22 -0700
Re: HTML inside a CANVAS "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-07-25 11:49 -0700
Re: HTML inside a CANVAS bit-naughty@hotmail.com - 2016-07-26 10:56 -0700
Re: HTML inside a CANVAS "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-07-26 16:26 -0700
Re: HTML inside a CANVAS bit-naughty@hotmail.com - 2016-07-28 07:22 -0700
Re: HTML inside a CANVAS "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-07-28 07:54 -0700
Re: HTML inside a CANVAS bit-naughty@hotmail.com - 2016-07-31 12:19 -0700
Re: HTML inside a CANVAS "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-08-01 12:16 +0200
Re: HTML inside a CANVAS Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-08-01 14:51 +0200
Re: HTML inside a CANVAS bit-naughty@hotmail.com - 2016-07-26 10:57 -0700
Re: HTML inside a CANVAS "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-27 00:21 +0200
Re: HTML inside a CANVAS "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-07-26 16:12 -0700
Re: HTML inside a CANVAS bit-naughty@hotmail.com - 2016-07-28 07:22 -0700
csiph-web