Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MyCircle = {}
- function MyCircle:new()
- local circle = display.newCircle(0, 0, 20)
- function circle:uno()
- print("circle uno")
- end
- local function dos()
- print("circle dos")
- end
- function tres()
- print("circle tres")
- end
- print("uno:", uno)
- print("dos:", dos)
- print("tres:", tres)
- return circle
- end
- print("uno:", uno)
- print("dos:", dos)
- print("tres:", tres)
- return MyCircle
- -- then in main.lua
- function showProps(o)
- print("-- showProps --")
- print("o: ", o)
- for key,value in pairs(o) do
- print("key: ", key, ", value: ", value);
- end
- print("-- end showProps --")
- end
- require "MyCircle"
- local circle = MyCircle:new()
- print("** _G props **")
- showProps(_G)
- print("** MyCircle props **")
- showProps(MyCircle)
- print("** circle props **")
- showProps(circle)
Advertisement
Add Comment
Please, Sign In to add comment