Class: AppDelegate

Inherits:
Object
  • Object
show all
Defined in:
app/app_delegate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#animationObject (readonly)

Returns the value of attribute animation.



2
3
4
# File 'app/app_delegate.rb', line 2

def animation
  @animation
end

#assetObject (readonly)

Returns the value of attribute asset.



2
3
4
# File 'app/app_delegate.rb', line 2

def asset
  @asset
end

Instance Method Details

#application(application, didFinishLaunchingWithOptions: launchOptions) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'app/app_delegate.rb', line 3

def application(application, didFinishLaunchingWithOptions:launchOptions)
  @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)

  @window.makeKeyAndVisible

  Walt.animate(
    assets: [{
      id: :blue,
      url: "http://upload.wikimedia.org/wikipedia/commons/3/30/Googlelogo.png",
      size: [300,100]
    }, {
      id: :red,
      text: "Hello World",
      text_color: "white",
      position: [20, 50]
    }],
    animations:[{
      duration: 3,
      operations:[{
        fade: :red,
        from: 0.0,
        to: 1.0
      }, {
        scale: :blue,
        from: 1.0,
        to: 2.0
      }, {
        move: :blue,
        to: 100
      }, {
        fade: :blue,
        from: 0.0,
        to: 0.5
      }],
      after: {
        duration: 2,
        operations:[{
          rotate: :blue,
          to: 40
        },{
          scale: :blue,
          to: 1.0
        }, {
          move: :blue,
          to: 50
        }, {
          fade: :blue,
          from: 0.5,
          to: 1.0
        }],
        after: {
          duration: 2,
          operations: [{
            rotate: :blue,
            to: 0
          },{
            move: :blue,
            axis: :y,
            to: 150
          }]
        }
      }
    }],
    in: @window
  )

  true
end