예제 #1
0
        public void UpdateScrollbar(float maxvalue)
        {
            this.maxValue = maxvalue;
            maxTextShow   = size.Y / fontHeight;

            this.barStep   = size.Y / 100f;
            this.valueStep = this.maxValue / 100f;

            float maxShow   = fontHeight * maxTextShow;
            float totalShow = fontHeight * maxvalue;

            float percentShown = maxShow / totalShow;

            if (maxShow < totalShow)
            {
                button.size.Y = size.Y * percentShown;
            }
            else
            {
                button.size.Y = size.Y;
            }

            startValue = (float)Scale.scale(button.size.Y, 0, size.Y, 0f, maxValue);

            button.SetBounds(Scale.hUnPosScale(Absolute_X) - Scale.hUnSizeScale(button.size.X) / 16f, Scale.vUnPosScale(Absolute_Y) + ((Scale.vUnSizeScale(this.size.Y) - Scale.vUnSizeScale(button.size.Y)) / 2f), null, null);
        }
예제 #2
0
        public virtual WidgetData ToWidgetData()
        {
            WidgetData data = new WidgetData();

            data.Name     = this.Name;
            data.ID       = this.ID;
            data.Enable   = this.Enable;
            data.Location = new Vector2(Scale.hUnPosScale(Absolute_X), Scale.vUnPosScale(Absolute_Y));
            data.Size     = new Vector2(Scale.hUnSizeScale(size.X), Scale.vUnSizeScale(size.Y));
            appearence.Foreach((e) => { data.appearenceData.Add(e.ToData()); });
            return(data);
        }
예제 #3
0
 public static float UnScaleHorizontal(this float value)
 {
     return(Scale.hUnPosScale(value));
 }