Ejemplo n.º 1
0
 public virtual GLEx SetColor(uint c)
 {
     this.SetTint(c);
     this.SetAlpha(LColor.GetAlpha(this.lastBrush.baseColor));
     this.lastBrush.fillColor  = c;
     this.lastBrush.patternTex = null;
     return(this);
 }
Ejemplo n.º 2
0
        public virtual void AddQuad(LTexture tex, int tint, Affine2f xf, float dx, float dy, float dw, float dh, float sx, float sy, float sw, float sh)
        {
            if (tex == null || tex.IsClosed())
            {
                return;
            }
            if (dw < 1f || dh < 1f || sw < 1f || sh < 1f)
            {
                return;
            }
            if (LColor.GetAlpha(tint) <= 0)
            {
                return;
            }

            /*
             * Texture = tex;
             * if (tex.Parent == null)
             * {
             *      float displayWidth = tex.width();
             *      float displayHeight = tex.height();
             *      float xOff = ((sx / displayWidth) * tex.widthRatio()) + tex.xOff();
             *      float yOff = ((sy / displayHeight) * tex.heightRatio()) + tex.yOff();
             *      float widthRatio = ((sw / displayWidth) * tex.widthRatio()) + xOff;
             *      float heightRatio = ((sh / displayHeight) * tex.heightRatio()) + yOff;
             *      AddQuad(tint, xf, dx, dy, dx + dw, dy + dh, xOff, yOff, widthRatio, heightRatio);
             * }
             * else
             * {
             *      LTexture forefather = LTexture.firstFather(tex);
             *      float displayWidth = forefather.width();
             *      float displayHeight = forefather.height();
             *      float xOff = ((sx / displayWidth) * forefather.widthRatio()) + forefather.xOff() + tex.xOff();
             *      float yOff = ((sy / displayHeight) * forefather.heightRatio()) + forefather.yOff() + tex.yOff();
             *      float widthRatio = ((sw / displayWidth) * forefather.widthRatio()) + xOff;
             *      float heightRatio = ((sh / displayHeight) * forefather.heightRatio()) + yOff;
             *      AddQuad(tint, xf, dx, dy, dx + dw, dy + dh, xOff, yOff, widthRatio, heightRatio);
             * }*/
        }
Ejemplo n.º 3
0
        public virtual void AddQuad(LTexture tex, int tint, Affine2f xf, float x, float y, float w, float h)
        {
            if (tex == null || tex.IsClosed())
            {
                return;
            }
            if (w < 1f || h < 1f)
            {
                return;
            }
            if (LColor.GetAlpha(tint) <= 0)
            {
                return;
            }

            /*
             * Texture = tex;
             *
             * if (tex.Parent == null)
             * {
             *      float u2 = tex.getFormat().repeatX ? w / tex.width() : tex.widthRatio();
             *      float uv = tex.getFormat().repeatY ? h / tex.height() : tex.heightRatio();
             *      AddQuad(tint, xf, x, y, x + w, y + h, tex.xOff(), tex.yOff(), u2, uv);
             * }
             * else
             * {
             *      LTexture forefather = LTexture.firstFather(tex);
             *      float u2 = tex.getFormat().repeatX ? w / forefather.width() : tex.widthRatio();
             *      float uv = tex.getFormat().repeatY ? h / forefather.height() : tex.heightRatio();
             *      if ((w < forefather.width() || h < forefather.height()) && !tex.Scale)
             *      {
             *              AddQuad(tint, xf, x, y, x + w, y + h, tex.xOff(), tex.yOff(), u2, uv);
             *      }
             *      else
             *      {
             *              AddQuad(tint, xf, x, y, x + w, y + h, tex.xOff(), tex.yOff(), forefather.widthRatio(), forefather.heightRatio());
             *      }
             * }*/
        }