public MaskHandler()
        {
            _shapePicker = new ShapePicker();

            FillModes      = Enum.GetValues(typeof(FillMode)).Cast <FillMode>().ToArray();
            ClipModes      = Enum.GetValues(typeof(ClipMode)).Cast <ClipMode>().ToArray();
            FontAttributes = Enum.GetValues(typeof(FontAttributes)).Cast <FontAttributes>().ToArray();

            EllipseMask = new EllipseMask {
                IsActive = false
            };

            TextMask = new TextMask
            {
                FontSize = 100,
                Text     = "Magic Gradients",
                IsActive = false
            };

            PathMask = new PathMask
            {
                Data     = _shapePicker.GetData("Xamagon"),
                IsActive = false
            };

            Collection = new MaskCollection
            {
                Masks = new GradientElements <GradientMask>
                {
                    EllipseMask, TextMask, PathMask
                }
            };

            ShowPickerCommand = new Command(() => ShowPicker());
        }
Example #2
0
        public MaskHandler()
        {
            _shapePicker = new ShapePicker();

            EllipseMask = new EllipseMask {
                IsActive = false
            };

            RectangleMask = new RectangleMask
            {
                IsActive = false,
                Corners  = new Corners(Dimensions.Abs(50, 50))
            };

            TextMask = new TextMask
            {
                FontSize = 100,
                Text     = "Magic Gradients",
                IsActive = false
            };

            PathMask = new PathMask
            {
                Data     = _shapePicker.GetData("Xamagon"),
                IsActive = false
            };

            Collection = new MaskCollection
            {
                Masks = new GradientElements <GradientMask>
                {
                    RectangleMask, EllipseMask, TextMask, PathMask
                }
            };

            ShowPickerCommand = new Command(() => ShowPicker());
        }
Example #3
0
 // Start is called before the first frame update
 void Start()
 {
     dropDown  = GetComponent <TMP_Dropdown>();
     shapePick = ReferenceShape.GetComponent <ShapePicker>();
 }