예제 #1
0
        internal bool SetPlacement(ButtonPart part, StageObject parent)
        {
            if (part.Character == null) return false;
            if (!part.CxForm.IsIdentity) CxForm = part.CxForm;
            Matrix = new VGMatrix(part.Matrix);

            if (part.Character != Character)
            {
                Object = part.Character.MakeInstance(this, parent.Root);
                if (Object == null) return false;
                Object.SetParent(parent);
                Character = part.Character;

                if (Object is IInstanceable)
                {
                    var obj = Object as IInstanceable;
                    obj.Load();
                }
            }

            return Object != null;
        }
예제 #2
0
 internal static DisplayObject CreateAndPlace(ButtonPart buttonPart, StageObject parent)
 {
     var obj = new DisplayObject(buttonPart.Depth);
     if (!obj.SetPlacement(buttonPart, parent))
         return null;
     return obj;
 }