Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Compare Lua Metatables VS Gideros OOP Approach — Gideros Forum

Compare Lua Metatables VS Gideros OOP Approach

amin13aamin13a Member
edited July 2014 in General questions
Which one is faster? and Why?

1- Lua Method:
local sprite = Sprite.new()
sprite.child = Sprite.new()

Doing some calculation with sprite.child

2- Gideros Method:
local sprite = Sprite.new()
local child = Sprite.new()

Doing some calculation with sprite:getChildAt(1)

I think using local variable for creating sprites is better but what about this in my code?

local test = self:getParent():getParent():getChildAt(2):getChildAt(3)


Sign In or Register to comment.