Veritas Machine

lua-users home
wiki

VeritasMachine 是 Lua-ObjC 繫結在 github 上的實作:https://github.com/tearsofphoenix/VeritasKit

您可以撰寫純 Lua 程式碼或加上 Objective-C 語法之程式碼。

它實作了大多數 Objective-C 語法, 例如 @autoreleasepool, @{}, @[], @YES。它也延伸了 Objective-C。

此機器可以在 iOS 裝置執行。以下是範例

local animation = function(view, background)
                                 [view setAlpha: 0]
                                 [UIView animateWithDuration: 0.5
                                                             animations: (^{
                                                                                        [view setAlpha: 1]
                                                                                        [background setFrame: CGRectMake(0, 0, 100, 100)]
                                                                                   })]
                           end

local theView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, 100, 200)]

local backgroundView = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @"background"]]

[theView addSubview: backgroundView]

[backgroundView release]


animation(theView, backgroundView)


最新變更 · 喜好設定
編輯 · 歷史
最後編輯於 2012 年 10 月 22 日 上午 9:19 GMT (diff)