Example #1
0
        protected override Control CreateControl()
        {
            var changed  = Changed.Adapt <int, AnySignalEditor> (this);
            var changedf = Changed.Adapt <float, AnySignalEditor> (this);

            return(FoldableContainer.WithLabel(Name, true, HAlign.Left,
                                               Container.LabelAndControl("Type: ",
                                                                         new Picker((int)NoiseKind,
                                                                                    React.By((int i) => NoiseKind = (WorleyNoiseKind)i).And(changed),
                                                                                    Enum.GetNames(typeof(WorleyNoiseKind))), true),
                                               Container.LabelAndControl("Seed: ",
                                                                         new NumericEdit(Seed, true, 1,
                                                                                         React.By((float i) => Seed = (int)i).And(changedf)), true),
                                               Container.LabelAndControl("CP Type: ",
                                                                         new Picker((int)ControlPoints,
                                                                                    React.By((int i) => ControlPoints = (ControlPointKind)i).And(changed),
                                                                                    Enum.GetNames(typeof(ControlPointKind))), true),
                                               Container.LabelAndControl("CP Count: ",
                                                                         new NumericEdit(ControlPointCount, true, 1,
                                                                                         React.By((float i) => ControlPointCount = (int)i).And(changedf).Filter(i => i > 2)), true),
                                               Container.LabelAndControl("Distance: ",
                                                                         new Picker((int)DistanceKind,
                                                                                    React.By((int i) => DistanceKind = (DistanceKind)i).And(changed),
                                                                                    Enum.GetNames(typeof(DistanceKind))), true),
                                               Container.LabelAndControl("Jitter: ",
                                                                         new NumericEdit(Jitter, false, 0.1f,
                                                                                         React.By((float x) => Jitter = x).And(changedf)), true),
                                               Container.LabelAndControl("Periodic: ",
                                                                         new Picker(Periodic ? 1 : 0,
                                                                                    React.By((int i) => Periodic = i != 0).And(changed),
                                                                                    "No", "Yes"), true)));
        }
Example #2
0
 protected override Control CreateControl()
 {
     return(FoldableContainer.WithLabel(Name, true, HAlign.Left,
                                        InputSignalControl("Source", Source),
                                        InputSignalControl("Other", Other),
                                        InputSignalControl("Mask", Mask)));
 }
Example #3
0
        protected override Control CreateControl()
        {
            var changed = Changed.Adapt <ColorMap <Vec3>, AnySignalEditor> (this);

            return(FoldableContainer.WithLabel(Name, true, HAlign.Left,
                                               InputSignalControl("Source", Source),
                                               new ColorMapEdit(0f, 1f, 20f, 200f, ColorMap, changed)));
        }
Example #4
0
        protected override Control CreateControl()
        {
            var changed = Changed.Adapt <float, AnySignalEditor> (this);

            return(FoldableContainer.WithLabel(Name, true, HAlign.Left,
                                               InputSignalControl("Source", Source),
                                               Container.LabelAndControl("Strength: ",
                                                                         new NumericEdit(Strength, false, 1f,
                                                                                         React.By((float s) => Strength = s).And(changed)), true)));
        }
Example #5
0
        protected override Control CreateControl()
        {
            var changed = Changed.Adapt <float, AnySignalEditor> (this);
            var fbEdit  = Container.LabelAndControl("First Band: ",
                                                    new NumericEdit(FirstBand, true, 1f, React.By <float> (ChangeFirstBand).And(changed)), true);
            var lbEdit = Container.LabelAndControl("Last Band: ",
                                                   new NumericEdit(LastBand, true, 1f, React.By <float> (ChangeLastBand).And(changed)), true);
            var sliders = Enumerable.Range(FirstBand, LastBand - FirstBand + 1)
                          .Select(BandSlider).ToArray();

            _bandContainer = Container.Horizontal(true, false, sliders);
            return(FoldableContainer.WithLabel(Name, true, HAlign.Left,
                                               InputSignalControl("Source", Source),
                                               fbEdit, lbEdit, _bandContainer));
        }
Example #6
0
        protected override Control CreateControl()
        {
            var changed  = Changed.Adapt <int, AnySignalEditor> (this);
            var changedf = Changed.Adapt <float, AnySignalEditor> (this);

            return(FoldableContainer.WithLabel(Name, true, HAlign.Left,
                                               Container.LabelAndControl("Seed: ",
                                                                         new NumericEdit(Seed, true, 1f, React.By((float s) => Seed = (int)s)
                                                                                         .And(changedf)), true),
                                               Container.LabelAndControl("Scale X: ",
                                                                         new NumericEdit(Scale.X, false, 1f, React.By((float s) => Scale = new Vec2(s, Scale.Y))
                                                                                         .And(changedf)), true),
                                               Container.LabelAndControl("Scale Y: ",
                                                                         new NumericEdit(Scale.Y, false, 1f, React.By((float s) => Scale = new Vec2(Scale.X, s))
                                                                                         .And(changedf)), true),
                                               Container.LabelAndControl("Periodic: ",
                                                                         new Picker(Periodic ? 1 : 0,
                                                                                    React.By((int i) => Periodic = i != 0).And(changed),
                                                                                    "No", "Yes"), true)));
        }