Skip to content
Anthony Ma edited this page May 25, 2015 · 1 revision

Inheriting components with txUI is accomplished with txUI.UIManager:inheritComponent. An example implementation is shown below.

local btn = txUI.Button:new({})
local newBtn = txUI.UIManager:inheritComponent(btn, {text = "New Button";})

The newBtn component is exactly the same as the btn component with the exception of text being overwritten with "New Button". Any number of fields can be overwritten this way, which allows for 'template' components.

Clone this wiki locally