Skip to content

Instantly share code, notes, and snippets.

View antonkartashov's full-sized avatar

Anton Kartashov antonkartashov

  • Orenburg, Russia
View GitHub Profile
obj =
x: 8 + 15
y: 8 + 15
width: 100
height: 200
obj2 =
x: 10, y: 20
width: 300, height: 400
obj3 = { x: 2, y: 4, width: 6, height: 8 }
obj4 = x: 2, y: 4, width: 6, height: 8
# Размер экрана у девайса
Screen.width
Screen.height
# Слой во весь экран
rect = new Layer
width: Screen.width
height: Screen.height
ellipse = new Layer
for i in [1...10]
x = i * i
print x
background = new BackgroundLayer backgroundColor: "#DDD"
square = new Layer
width: 250, height: 250
backgroundColor: "#FFF", borderRadius: 25
square.states.animationOptions =
curve: "spring(250,25,0)"
square.center()
square.states.add
second: scale: 1.5, rotation: 225
third: scale: 0.5, blur: 25, borderRadius: 250
square.on Events.Click, ->
square.states.next()
var getDuration = function (speed, distance) {
var time = distance / speed;
return time;
}
var duration = getDuration(25, 300);
getDuration = (speed, distance) ->
speed / distance
duration = getDuration 25, 300