Veritas Machine

lua-users home
wiki

Showing revision 2
VeritasMachine is an implementation of Lua-ObjC bind on github:https://github.com/tearsofphoenix/VeritasKit. You can write pure lua code or code with Objective-C syntax. It has implemented most Objective-C syntax, such as @autoreleasepool, @{}, @[], @YES. It also has extended the Objective-C. The machine can run on iOS device. Here is a sample example:

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)


RecentChanges · preferences
edit · history · current revision
Edited October 22, 2012 8:04 am GMT (diff)