Thursday, May 16, 2013

Coherent UI is now available on Unity3D Asset Store



We’re really happy to announce that Coherent UI for Unity3D is now available on the Asset Store. Buy Basic or Standard version or download a free trial from Coherent Lab’s website.   


All versions of Coherent UI for Unity3D can be used for the creation and implementation of HUDs, menus, dialogs and in-game browsers. Our GUI library currently supports Windows (32 and 64 bit) and Mac OS X and soon we’re going to add Linux as well.


The Basic version covers all the primary needs of game UI developers allowing them to have both HUD and in-game browser at the same time. Standard gives more creative freedom because it allows unlimited number of views, SSL support, on-demand views and control view framerate, features needed for more complex projects.


We encourage Unity3D developers to take a look at our GUI library and to give us their feedback about it. All of your reviews and ratings will help us a lot with the future development of the product. We are always open to discuss ideas for new features and tools that will be of benefit for game UI developers.

For a quick start guide we suggest a look at our previous post Coherent UI in the Unity3D editor - Introduction. For more resources and tutorials follow the Unity3D tag on our blog or @CoherentLabs on Twitter.

Wednesday, May 8, 2013

Using TypeScript with Coherent UI

Previously we announced the automatic binding of .Net methods for Coherent UI. It greatly simplifies exposing the game to the UI, but also has some additional advantages that I want to share. Binding .Net methods allows to expose the game using concrete, separate interfaces. This allows for better structuring of the UI code - think of OOP and separation of concerns. It also allows for taking advantage of  more advanced and modern web programming techniques, tools and languages like TypeScript.

TypeScript is a new language that compiles to pretty human read-able and efficient JavaScript while adding some desirable features:
  • optional static typing - catch errors while making them
  • lots of EcmaScript 6 features - arrow functions, classes with inheritance, modules
  • much better editor support - autocompletion and error highlighting in Visual Studio
Say you have a Player class with inventory consisting of list of items
You need to declare the Player class and the Item struct in order to take advantage of the static type checks.

The /// reference path="coherent.d.ts" includes the declaration of Coherent UI JavaScript API. This allows us to declare that the GetEquipment method returns a promise. Whenever you call the player.GetInventory() method in JavaScript, Coherent UI will call the player.GetInvetory() in the .Net universe and will resolve the promise with the returned list of items. You can download the declaration file of Coherent UI from here. So what is left to take advantage of TypeScript features - here is a screenshot of Visual Studio's Intellisense showing the documentation of the engine.on method:



In its next release TypeScript is going to have two major new features - generics and overloading on constants. They are going to make using Coherent UI with TypeScript even better and so expect more posts about using TypeScript with Coherent UI.