By the way, as a sidenote, while explaining my ReflectedImage widget
(see demo @ http://www.zwitserloot.com/tipit-gwtlib/example) to my
roommate who programs for a job as well, I mentioned that there's no
way to pull that off in Firefox 1.0 (no ActiveX controls that can do
it, and no canvas support either). But then the strategy used by
ClippedImage came to mind - you CAN do it, though it's a bit heavy on
the DOM:
To reflect an image and add a gradient-to-transparancy effect to the
reflection, without using IE-only filters or Canvas, you can simply
render each line of the reflection using 1 DOM div with a height of
1px that uses ClippedImage's strategy to render just the right line.
This div can then be made transparent, or if that can't be done, and
if the 'background' is simply a normal color (usually it is), you can
absolute-place another div with the same dimensions and colour as the
background on top, and change the transparency of that.
Probably too much effort just to support a mostly frivolous effect on
very old browsers, but it goes a ways to show the flexibility of the
whole clipped image thing. I didn't actually write it (yet?), though.
> http://timepedia.blogspot.com/2007/06/gwt-canvas-rendering-rotated-te...
>
> -Ray
I actually wrote bomberman in canvas (http://www.zwitserloot.com/
bomberman - not GWT, just js + canvas) and as you can see it runs
quite smoothly (space to start game, sometimes you need to reload if
it doesn't appear, I added some very annoying music so you may want to
turn down the volume, and once a player dies, you can't go back - just
reload to start another game).
JS implementations are getting faster, and CPUs are getting better, so
I don't think you're crazy at all!
I too think Flash is the only viable option (well, applets are a close second, but unusable until Sun solves the startup issue), and Flash has the benefit of being widely deployed, cross-browser, cross-platform, and even on some mobile devices.
1) I found it amazing that Flash's rotated font rendering doesn't extend to arbitrary dynamically loadable OpenType/TrueType, but I'm guessing it's an issue with cross platform portability? (e.g. making sure OpenType/TrueType is available everywhere? Making a legacy licensing issue for Macromedia before Adobe acquired them?)
2) Although I agree that Flash is the "implementation", I think Canvas is the "interface". That is, I would desire an API that is not coupled tightly with
Flash's underlying APIs and capabilities ( e.g. MovieClip)
I think if the Canvas interface is designed appropriately, it will enable a high performance default Flash implementation, as well as leaving the future open
for Silverlight, WHATWG Canvas+Text, etc.
My model for this is OpenGL, I like OGL's high level approach of not exposing underlying details like raw surfaces with pointers, instead using handles. DirectX9-10 have achieved parity and beyond, but I dislike DX's 'direct' approach of exposing hardware more directly vs OpenGL's 'opaque handle' approach.
I think we need to design a 2D equivalent of OGL for GWT. A lightweight procedural interface for drawing that is abstract enough to support varying
implementations, but with the right abstractions to permit easy high-performance implementations.
A case in point is the beginFrame/endFrame() abstraction. On implementations where immediate mode is blisteringly fast, it's a no-op. On implementations where it is better to collect a command buffer and then execute it all at once, it permits better performance (Flash, Opera "GameCanvas" LockCanvas(), etc)
g.beginFill(0xffcc7f, 255);
g.path("M,93,68,L,96,72,100,73,106,72,108,66,105,63,100,62");
g.endFill();
I think we are ahead of the curve somewhat, but this is an extremely exciting area for me, so count me in on any project to build a GWT rendering api. :)
(Can we sneak in our own high speed rendering canvas through Google Gears :) ?)