Sunday, October 16, 2011

GWT and HTML Canvas

I started to learn Google Web Toolkit this weekend and am very pleasantly surprised.
I installed it via Eclipse update site and got right to work.
I was able to manipulate the base project and look at the demos to figure out stuff.
I was interested in creating a demo site using HTML 5 Canvas. With little effort and writing zero JavaScript I was able to get an effective Demo.
I used mainly base GWT classes but I did use some of the classes in gwt-g2d. The main classes appear to be partly integrated into GWT so I mainly just used the support classes. It would be nice if gwt-g2d did some of the things it had on it's list and wrapped GWT's canvas classes.
GWT's tooling was very refreshingly fast and easy to use.
I was able to write a little demo artificial intelligence app to show off different programming techniques I had learned in the class I'm taking.

It would be nice if I could fail over my canvas to something else for browsers that don't support HTML 5. LimeJS appears to do this autmatically. LimeJS is probably better for writing HTML based games but I don't want to write a bunch of JavaScript which is why I like GWT. GWT automatically converts all my Java code into JavaScript for me.

Another thing is it puts the war contents in a war directory. All the conventions I've seen it is always a WebContent folder. Also the default source and test directories don't match the standard Maven structure which I imagine I could manually change but it's nice to be able to do it when creating a new project.

No comments: