Skip to content

Instantly share code, notes, and snippets.

View tonylukasavage's full-sized avatar
💭
Learning to make games

Tony Lukasavage tonylukasavage

💭
Learning to make games
View GitHub Profile
@tonylukasavage
tonylukasavage / app.tss
Created August 16, 2012 16:33
revised Alloy controller format
"Window": {
backgroundColor: '#fff'
},
"Label": {
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#000",
font: {
fontSize: '32dp'
}
@tonylukasavage
tonylukasavage / index.js
Created August 17, 2012 14:36
Accessing top-level window globally in Alloy
// You can attach properties right to the Alloy.CFG object and they will be available
// throughout your application. You can obviously name this whatever you want.
Alloy.CFG.topLevelWindow = $.index;
// the rest of your controller code
@tonylukasavage
tonylukasavage / index,js
Created August 19, 2012 00:14
"Invisible TabGroup" hack with alloy
function doClick(e) {
alert($.label.text);
}
var c = Ti.UI.createButton({
title: 'Close',
style: Ti.UI.iPhone.SystemButtonStyle.PLAIN
});
$.window.leftNavButton = c
@tonylukasavage
tonylukasavage / index.xml
Created August 30, 2012 14:36
Alloy "platform" attribute
<Alloy>
<Window>
<!-- all platforms -->
<View/>
<!-- only on ios will this element, and all its subviews, appear -->
<View platform="ios">
<View/>
</View>
@tonylukasavage
tonylukasavage / index.js
Created September 3, 2012 19:17
Alloy Tabs for Jamil
function doClick(e) {
var nextWindow = Alloy.getController('webwindow');
$.myTab.open(nextWindow.getView());
};
$.index.open();
@tonylukasavage
tonylukasavage / search.txt
Created September 11, 2012 15:10
Alloy twitter search
-shears -fibre -fuselage -shuttle -steel -dental -"heart is titanium alloy" -screwdriver -rust -passion -coupe -"lead foot" -aluminum -aluminium -CSPM -suspension -iron -magnesium -shaft -garage -polished -knit -footwear -racket -rims -silver -metal -metallic -gold -needle alloy -wheel -wheels -cosmetic (mobile OR development OR dev OR controller OR backbone OR mvc OR widget OR appcelerator OR titanium OR framework)
@tonylukasavage
tonylukasavage / alloy_index.js
Created September 11, 2012 20:25
Traditional vs. Alloy Titanium dev
$.index.open();
@tonylukasavage
tonylukasavage / index.js
Created September 14, 2012 21:04 — forked from kenhkan/index.js
exports.* does not effect on-screen elements
$.hide.addEventListener("click", function(e) {
// don't create a new instance, use the one the markup creates for you
// you when you use the <Require> tag.
//
// var views = Alloy.createController("views");
// views.hide();
$.views.hide();
});
@tonylukasavage
tonylukasavage / book.js
Created September 19, 2012 23:08
New models (Alloy)
exports.definition = {
config: {
"columns":
{
"book": "string",
"author": "string"
},
"adapter": {
"type": "sql",
"collection_name": "books"
@tonylukasavage
tonylukasavage / alloy.jmk.js
Created September 20, 2012 12:09
alloy.jmk paths
task("pre:compile", function(event,logger) {
var projectPath = event.dir.project; // will be "event.paths.project"
var appPath = event.dir.home; // will be "event.paths.app"
});
task("post:compile",function(event,logger){
});