Exemplo n.º 1
0
        public void SetupPanel()
        {
            this.SetStyleAuto(null);
            this.ControlBar = new ControlBar("Model Properties", ResourceCache.GetFont("Fonts/Anonymous Pro.ttf"));
            this.AddChild(this.ControlBar);
            this.ControlBar.SetStyleAuto(null);
            this.SetMinSize(this.Parent.Size.X, 150);
            this.SetLayout(LayoutMode.Vertical, 6, new IntRect(6, 6, 6, 6));
            this.SetAlignment(HorizontalAlignment.Center, VerticalAlignment.Bottom);


            PositionField = new VectorField(Node.Position, "PosX", "PosY", "PosZ");
            PositionField.VerticalAlignment = VerticalAlignment.Top;
            this.AddChild(PositionField);
            PositionField.SetStyleAuto(null);
            RotationField = new QuaternionField(Node.Rotation, "RotX", "RotY", "RotZ");
            RotationField.VerticalAlignment = VerticalAlignment.Top;
            this.AddChild(RotationField);
            RotationField.SetStyleAuto(null);

            ScaleSlider = new RangeSlider("Scale", 0.1f, 5.0f);
            ScaleSlider.SetStyleAuto(null);
            this.AddChild(ScaleSlider);
            ScaleSlider.Value = 1.0f;
            this.Name         = "ModelPanel";
        }
Exemplo n.º 2
0
        protected RangeSlider CreateSlider(string label, Single minRange = 0.0f, Single maxRange = 1.0f)
        {
            RangeSlider slider = new RangeSlider(label, minRange, maxRange, 30);

            this.AddChild(slider);

            return(slider);
        }
Exemplo n.º 3
0
        public void SetupPanel()
        {
            this.SetStyleAuto(null);

            this.SetMinSize(this.Parent.Size.X, 100);
            this.SetLayout(LayoutMode.Vertical, 6, new IntRect(6, 6, 6, 6));
            this.SetAlignment(HorizontalAlignment.Center, VerticalAlignment.Bottom);
            this.ControlBar = new ControlBar("Material Properties", ResourceCache.GetFont("Fonts/Anonymous Pro.ttf"));
            this.AddChild(this.ControlBar);
            this.ControlBar.SetStyleAuto(null);

            if (material.isSet("RefractIndex"))
            {
                IORSlider                = this.CreateSlider("Ior Ratio", 0.0f, 1.0f);
                IORSlider.Value          = material.RefractIndex;
                IORSlider.SliderChanged +=
                    (args => material.RefractIndex = args.Value);
            }

            if (material.isSet("MatRefractColor"))
            {
                RefractSlider                = this.CreateSlider("Refract", 0.0f, 1.5f);
                RefractSlider.Value          = material.MatRefractColor.X;
                RefractSlider.SliderChanged +=
                    (args => material.MatRefractColor = Vector3.One * args.Value);
            }

            if (material.isSet("MatDiffColor"))
            {
                DiffSlider                = this.CreateSlider("Texture", 0.0f, 1.5f);
                DiffSlider.Value          = material.MatDiffColor.X;
                DiffSlider.SliderChanged +=
                    (args => material.MatDiffColor = Vector4.One * args.Value);
            }
            if (material.isSet("MatEnvMapColor"))
            {
                EnvSlider                = this.CreateSlider("EnvMap", 0.0f, 1.5f);
                EnvSlider.Value          = material.MatEnvMapColor.X;
                EnvSlider.SliderChanged +=
                    (args => material.MatEnvMapColor = Vector3.One * args.Value);
            }
        }