コード例 #1
0
            public HsvColorProperty()
            {
                MinValue  = Vector3.Zero;
                MaxValue  = new Vector3(360f, 100f, 100f);
                Increment = Vector3.One;

                Flags         = BlockPropertyFlags.CanUseMultipliers;
                ValueType     = BlockMemberValueTypes.ColorHSV;
                dispBuilder   = new StringBuilder();
                ColorChannels = new IBlockNumericValue <float>[3]
                {
                    new HsvColorPropertyChannel(this, "H", 0),
                    new HsvColorPropertyChannel(this, "S", 1),
                    new HsvColorPropertyChannel(this, "V", 2),
                };
            }
コード例 #2
0
            public ColorProperty()
            {
                MinValue      = Color.Black;
                MaxValue      = Color.White;
                Increment     = new Color(1, 1, 1);
                Flags         = BlockPropertyFlags.IsIntegral | BlockPropertyFlags.CanUseMultipliers;
                ValueType     = BlockMemberValueTypes.Color;
                dispBuilder   = new StringBuilder();
                ColorChannels = new IBlockNumericValue <byte>[3]
                {
                    new ColorPropertyChannel(this, "R", 0),
                    new ColorPropertyChannel(this, "G", 1),
                    new ColorPropertyChannel(this, "B", 2),
                };

                hsvWrapper = new HsvToRgbPropWrapper();
            }
コード例 #3
0
            public override void SetData(object member, Action CloseWidgetCallback)
            {
                floatMember = member as IBlockNumericValue <float>;
                textMember  = member as IBlockTextMember;
                this.CloseWidgetCallback = CloseWidgetCallback;

                absRange = Math.Abs(floatMember.MaxValue - floatMember.MinValue);
                logRange = Math.Ceiling(Math.Log10(absRange));

                SetSliderValue(floatMember.Value);
                sliderBox.NameBuilder.SetText(floatMember.Name);
                sliderBox.MouseInput.GetInputFocus();
                sliderBox.CharFilterFunc = textMember.CharFilterFunc;
                initValue = floatMember.Value;

                if (BindManager.IsChatOpen && !sliderBox.IsTextInputOpen)
                {
                    sliderBox.FieldText.SetText(textMember.ValueText);
                    sliderBox.OpenTextInput();
                }
            }
コード例 #4
0
 public override void Reset()
 {
     floatMember         = null;
     CloseWidgetCallback = null;
     sliderBox.CloseTextInput();
 }