MOAIProp:setParent() replacement

1 vote · 0 comments

MOAIProp:setParent() was deprecated so this is function shows how to link a prop to a parent prop's transform and optionally color & visibility.

raw ·
· download
function setParent( prop, parent ) prop:setAttrLink( MOAIProp2D.INHERIT_TRANSFORM, parent, MOAIProp2D.TRANSFORM_TRAIT ) -- Uncomment for color inheritance -- prop:setAttrLink ( MOAIProp2D.INHERIT_COLOR, parent, MOAIProp2D.COLOR_TRAIT ) -- Uncomment for visibility inheritence -- prop:setAttrLink( MOAIProp2D.ATTR_VISIBLE, parent, MOAIProp2D.ATTR_VISIBLE ) end

Be the first to comment

Sign in with OpenID