Tuesday, June 21, 2011

UI Controls

Something new in The Render Engine v2.0!!  I've added a new demo which showcases the new UI controls in the CanvasContext.  They are still early in development, but when I abandoned the UI concept a while back, I figured it would be something people would accomplish within the browser with jQuery or something similar.  However, there isn't a good way to get UI controls, especially input controls, into graphical contexts.  There's now a new demo for them.  It only functions in Chrome right now, but I'll get it working in the other browsers soon enough.

I plan to add a few more UI controls: drop down, list, slider, and progress bar before this is done.  The nice thing is that all of the controls can be styled via CSS.  Only a limited set of selectors is applied, currently, but it's enough that you can get some nice visuals.  Furthermore, all of the UI controls have events for the default mouse actions.  Extending the existing controls shouldn't be too hard, so you'll be able to create custom controls for each of them which fit your game's requirements.

I don't plan on adding support for all of CSS, so it isn't a matter of whether it's a bug or not.  I only need to support a few selectors so that creating UI's won't be too tedious.  I'm also hoping that I can revive the JSON format for creating user interfaces since, currently, it takes up a lot of code to create a simple form.

No comments:

Post a Comment