Skip to content

How to create and use your own components by example

navidn edited this page Jan 22, 2012 · 1 revision

The following Gist shows on a small example how to use Kranium to build a self defined component (in this example: a overlay HUD, thx go to https://github.com/raulriera/Overlay-HUD/blob/master/overlayHUD.js)

https://gist.github.com/1657255

It explains the following basics topics

  • how to define a self defined component that extends (here) the Window Base Element
  • how to use the automatically called init()-Method to initialize the component, creating accessible widgets for further methods
  • how to add customized show(), hide() and setMessage() methods to it and how to access the Ti-Object within that methods
  • how to access the underlying Ti-Instance of Kranium Instance by using the 'inst' property

I hope that helps to start with your own components. (Navid, https://github.com/navidn)

Clone this wiki locally