Tampilkan postingan dengan label Function in Lua. Tampilkan semua postingan
Tampilkan postingan dengan label Function in Lua. Tampilkan semua postingan

Corona - Display Groups

Posted by Unknown Kamis, 24 Oktober 2013 0 komentar

local Group1 = display.newGroup()

This creates a new display group by the name of Group1. You can then add display objects to it.You should declare them near the top of your Lua document.You should create display groups in a specific order. The first declared group will actually reside behind the next group in visually layered order.

local farBackground = display.newGroup()
local nearBackground = display.newGroup() --this will overlay 'farBackground'
local foreground = display.newGroup() --and this will overlay 'nearBackground'


Baca Selengkapnya ....

Tables In Corona

Posted by Unknown Jumat, 13 September 2013 0 komentar
The table constructor is written using braces
(curly brackets) as in { }

t = {}   -->create a table

k = "x"
t[k] = "tabvalue" --new table entry,
-->with key="x" and value=2.4

print( t[k] ) --> 2.4
print( t["x"] ) --> 2.4
print( t.x ) --> 2.4

t[2] = "tabval2" --new table entry,
-->with key=2 and value="tabval2"
t[3]= 2.4
print( t[2] ) --> "tabval2"
print( t[3] )

Baca Selengkapnya ....

Function in Corona

Posted by Unknown Kamis, 22 Agustus 2013 0 komentar
Using functions are very eazy in Lua.We can provide arguments as input (within the parentheses), the function performs some tasks, and the results can be returned.
Some ways to define functions are:
      
local function f ()
--body
end

local f = function()
--body
end

function f ()
--body
end

f = function ()
--body
end

Baca Selengkapnya ....
Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android populer.