May 3rd, 2011

New Interface Templates

I updated the interface template file today to take advantage of some of the 1.2 coding conventions. For example, buttons can now have label text without requiring a separate label widget defined; just add the “label” property to any button widget and pass some text as a value. Also, I added shorthand syntax for defining boundary rectangles:

/**** before (and still valid, but not the most efficient) *****/
"x": 0, "y": 0, "width": .654, "height": .3

/**** as of 1.2 ****/
"bounds": [0, 0, .654, .3]

These two changes (bounds & button labels) cut the code for the interface template (any many other interfaces) in half.

I also added a multipage interface template file. You can use different pages to define separate screens of widgets; you can move between these pages by pressing the provided buttons in the template (this functionality could also be mapped to a slider). The javascript for switching pages can either target a specific page:


or can change pages relatively:


The “info” button in all the default interfaces included with Control just calls the changePage() method and takes you to a page containing nothing but a label with informational text and a back button.


No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

This work is licensed under GPL - 2009 | Powered by Wordpress using a heavily modified version of the theme aav1