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 / search.txt
Created May 16, 2014 13:48
Alloy twitter search
((alloy AND appcelerator) OR #tialloy) -Q&A
@tonylukasavage
tonylukasavage / .gitignore
Created November 29, 2011 14:03
.gitignore for Titanium Mobile projects
tmp
.DS_Store
build/iphone/*
!build/iphone/.gitignore
build/android/*
!build/android/.gitignore
.settings
build.log
.fastdev.lock
//Wrapper class to create extensible Titanium components
function Component(/*Object*/ tiView) {
var self = {
__viewProxy:tiView
};
//passthrough for add
self.add = function(/*Object*/ tiChildView) {
var v = tiChildView.__viewProxy||tiChildView;
self.__viewProxy.add(v);
//Component Base
var Base = {
log: function(str) {
Ti.API.info(str);
}
};
//construct a new component object
Base.create = function(funcs) {
var context = {
module.exports = Alloy.getController('BaseController').extend({
customFunction: function(){ alert('inherited function call!'); }
});

Underscore prefix indicates that the function is created and performed by Alloy. All non-Alloy functions below will be optional;

  • __init - Establish $ as this
  • prelayout - Before any UI is created. Good time to update Alloy.CFG with runtime values for use in styles.
  • __layout - All UI elements are created and added to the view hierarchy
  • postLayout - Everything is prepared, this is where the bulk of the code will go and where beginners will spend all their time.
@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'
}
@kwhinnery
kwhinnery / notes.md
Created September 7, 2012 19:03
Kevin's Alloy Notes from Codestrong app

Alloy Notes

Blockers

None

Framework Needs

  • Need attributes for basic logic (if this, show this)
  • Need attribute for not adding something to the view hierarchy automatically
  • Need to use JS in XML attributes - use case: use L() macro for TextField hintText property
@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)
@k0sukey
k0sukey / alloy.jmk (CoffeeScript)
Created November 17, 2012 13:02
Alloy with CoffeeScript / TypeScript
task("pre:compile", function(event,logger) {
var wrench = require("wrench"),
fs = require("fs"),
path = require("path"),
coffee = require("coffee-script");
event.alloyConfig.coffee = [];
wrench.readdirSyncRecursive(event.dir.home).forEach(function(target){
if (target.match(/\.coffee$/)) {