Created
September 18, 2012 23:18
-
-
Save h5y1m141/3746672 to your computer and use it in GitHub Desktop.
titanium sample use CoffeeScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User = require('user') | |
u = new User('太郎') | |
name = u.getName() | |
name1 = u.changeName('花子') | |
Ti.API.info name | |
Ti.API.info name1 | |
win1 = Ti.UI.createWindow | |
title:'tab1' | |
backgroundColor:'#fff' | |
label1 = Ti.UI.createLabel | |
text:name | |
left:5 | |
top:5 | |
height:50 | |
backgroundColor:'#fff' | |
font: | |
fontSize:26 | |
fontWeight:'bold' | |
fontFamily:"Helvetica Neue" | |
label2 = Ti.UI.createLabel | |
text:name1 | |
left:5 | |
top:60 | |
height:50 | |
backgroundColor:'#fff' | |
font: | |
fontSize:26 | |
fontWeight:'bold' | |
fontFamily:"Helvetica Neue" | |
win1.add label1 | |
win1.add label2 | |
win1.open() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
constructor: (@name) -> | |
getName: -> | |
return @name | |
changeName:(name) -> | |
@name = name | |
module.exports = User |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment