Ejemplo n.º 1
0
        public virtual void SetBounds(float?x, float?z, float?width = null, float?height = null)
        {
            float parentX = Parent == null ? 0 : Parent.Absolute_X;
            float parentz = Parent == null ? 0 : Parent.Absolute_Y;

            if (x.HasValue)
            {
                location.X = Scale.hPosScale(x.Value) - parentX;
            }

            if (z.HasValue)
            {
                location.Y = Scale.vPosScale(z.Value) - parentz;
            }

            if (width.HasValue)
            {
                size.X = Scale.hSizeScale(width.Value);
            }

            if (height.HasValue)
            {
                size.Y = Scale.vSizeScale(height.Value);
            }

            Singleton <GUI> .INSTANCE.Dirty = true;
        }
Ejemplo n.º 2
0
 public static float ScaleHorizontalSize(this float value)
 {
     return(Scale.hSizeScale(value));
 }
Ejemplo n.º 3
0
 public void MatchTextureBounds(Widget widget)
 {
     widget.size.X = Scale.hSizeScale(texture.Width) * 2 * Singleton <GUI> .INSTANCE.scale;
     widget.size.Y = Scale.vSizeScale(texture.Height) * 2 * Singleton <GUI> .INSTANCE.scale;
 }