Topic:   JavaScript   (Read 21767 times)


0 Members and 1 Guest are viewing this topic.

Charlo


  • GMG-er

  • **


  • Posts: 451
Re: JavaScript
« Reply #15 on: March 19, 2011, 12:01:45 PM »
Hmm, I missed this thread the first time around.  I know JavaScript quite well and have toyed with the idea of making a game with it, using an HTML table as the "screen".  However, the canvas element changes that.  I think the idea of the canvas element is that you can draw whatever you want to it with JavaScript, so you're not limited to presenting your graphics with only basic HTML elements.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: JavaScript
« Reply #16 on: March 19, 2011, 12:04:47 PM »
Quote
I think the idea of the canvas element is that you can draw whatever you want to it with JavaScript, so you're not limited to presenting your graphics with only basic HTML elements.
What do you mean? Is it just like a div?
I survived the spammage of 2007

Charlo


  • GMG-er

  • **


  • Posts: 451
Re: JavaScript
« Reply #17 on: March 19, 2011, 02:25:33 PM »
Quote
What do you mean? Is it just like a div?
A good comparison would be the paint commands in SC, I think.  You can draw rectangles, circles, lines, etc. on the canvas element.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: JavaScript
« Reply #18 on: March 19, 2011, 05:32:26 PM »
Oh, I'm not too pushed on that sort of thing. As long as Phonegap supports div and img tags I'll be a happy chappy. ;D
I survived the spammage of 2007

x


  • GMG-er

  • **


  • Posts: 247
Re: JavaScript
« Reply #19 on: March 19, 2011, 10:53:26 PM »
The HTML5 canvas supports sprites, and animated sprites natively.

http://codeutopia.net/blog/2009/08/21/using-canvas-to-do-bitmap-sprite-animation-in-javascript/

Thats why its cool. Its also a lot faster than using JS to change div/img properties, but I guess thats not really an issue here.

Having said that, a html table makes perfect sense with the roguesoft grid engine!

PS: Just so you know, Phonegap supports anything safari can render. Since it gets safari to "render" each "frame".
« Last Edit: March 19, 2011, 10:54:58 PM by x »