Latest version: v0.1.0-beta.1 (changelog). View docs
See here for information regarding NEW developer tools
Well, I know what you are thinking, another substandard GUI framework. Not so fa–. Yeah, you are likely correct. I would appreciate if you would hear me out though.
Firstly, before I get going I would like to extend an invitation to my Gitter room
Titanium is an 'advanced' GUI framework written in OOP, using a comprehensive custom class engine. It is focused on usability and extensibility. As a result, classes provide static methods to adjust the way the function on a global scale. Titanium uses 'nodes' to display information. A node is, a button, dropdown, text input, scroll container, etc…
To speed up your development, Titanium makes use of a feature named TML (Titanium Markup Language). This XML like language allows you to define your application layout without touching any Lua (example), then simply import it to parse the file and get going. Theme files are also in use (example), they use the same syntax as TML files and allow you to define appearance rules to nodes with certain IDs or classes (or all nodes of a certain type).
Node Queries
Node queries are a massive feature of Titanium (example), allowing you to specifically search for node(s) inside of a parent. They follow jQuery/CSS like structure, this is perfectly valid:
Container > ScrollContainer#wrapper #inner > Container.header > Label#header1
This would search for a Label with id 'header1', directly inside a container with class 'header', directly inside any element with id 'inner', inside a ScrollContainer with an id of 'wrapper' directly inside a Container.
*directly inside means that the node must be a direct child of it's parent (ie: not nested)
Dynamic Values
Dynamic values are pretty awesome, and are powerful when developing a dynamic UI.
-- Sets the buttons width to its text length, +2 (for padding)
button.width = "$#self.text + 2"
-- Sets the X of this button to the X of another, plus the other buttons width (+2 for spacing). This makes it appear 2 pixels AFTER the other button
button.X = "${#myOtherButton}.X + {#myOtherButton}.width + 2"
-- The {} contain a NodeQuery. The first result of the query is used to get the X and width property.
The $ in both of those examples indicates that the string value is to be parsed as a dynamic value.
I could go on for a while, so here is a list of what Titanium currently offers:
- A fleshed out custom class system (single inheritance, mixins, constructor configuration, statics, instance keys, super access, etc)
- TML
- Theme files
- Button
- Checkbox
- Container (no scrolling)
- ScrollContainer (…scrolling)
- ContextMenu
- Dropdown
- Image
- Input (single line, text)
- Label (single line of text)
- PageContainer and Pages (allows quick, easy switching of the application layout)
- Pane (solid block of colour)
- RadioButton
- TextContainer
- EditableTextContainer
- Terminal (allows emulation of term programs)
- Node queries
- Animations with over 40 different easing functions
- Windows (documentation pending)
- DynamicValues (pretty damn awesome, tutorials coming soon)
- Native monitor support (Projector)
- Event binding (for example, assign callbacks (as many as you want) to a certain event: application:on(event, function))
- TabbedPageContainer New!
- DialogWindow New!
Here is a GIF showing the example application. Want to get a more up to date preview? Download it, do it!
Download, Installation and Documentation
This website is still in development, but contains a lot of helpful class documentation (automatically updated), guides and information regarding the installation of Titanium.
The Titanium packager is helpful for users creating projects with Titanium, it will automatically download and start Titanium, as well as creating your custom classes (if any). It is the easiest way to get started.
If you would rather download Titanium manually, TPM can be used – or you can build the source directly.
Lets wrap this up
I am open to ideas and merge requests, and as such feel free to fork the repo. If you find an issue please submit it through GitLab if you can and it isn't a duplicate issue.
This code is licensed under MIT. Feel free to use Titanium builds in any of your projects (credit would be nice, but not required when only using the build file). Let me know of any cool stuff you make.
If you use the Titanium source in your project, the license must remain with the code and be kept intact.
For an alpha project, I think most would agree this is not too bad. Hopefully, this will become a competitor to the more popular frameworks on the forums.
More sophisticated download/install options will exist upon official release.
If you got this far, thank you for reading - seriously. I look forward to reading your responses. Like Titanium? Don't hesitate to show your support in the GitLab repo (star) or up vote this topic.