コード例 #1
0
        public void drawCustom(spriteBatcher spriteBatcher, spriteMat _mat, spriteRect uv, spriteRect rect, spriteColor c, spriteColor c2)
        {
            _mat.tex0 = this;
            {
                var p = this.pointbuf[0];
                p.x = rect.x; p.y = rect.y; p.z = 0;
                p.u = uv.x; p.v = uv.y;
                p.r = c.r; p.g = c.g; p.b = c.b; p.a = c.a;

                p   = this.pointbuf[1];
                p.x = rect.x + rect.w; p.y = rect.y; p.z = 0;
                p.u = uv.x + uv.w; p.v = uv.y;
                p.r = c.r; p.g = c.g; p.b = c.b; p.a = c.a;

                p   = this.pointbuf[2];
                p.x = rect.x; p.y = rect.y + rect.h; p.z = 0;
                p.u = uv.x; p.v = uv.y + uv.h;
                p.r = c.r; p.g = c.g; p.b = c.b; p.a = c.a;

                p   = this.pointbuf[3];
                p.x = rect.x + rect.w; p.y = rect.y + rect.h; p.z = 0;
                p.u = uv.x + uv.w; p.v = uv.y + uv.h;
                p.r = c.r; p.g = c.g; p.b = c.b; p.a = c.a;
            }
            spriteBatcher.setMat(_mat);
            spriteBatcher.addRect(this.pointbuf);
        }
コード例 #2
0
        public void drawByTexture(spriteBatcher sb, string sname, spriteRect rect, spriteColor c)
        {
            if (this.texture == null)
            {
                return;
            }
            var r = this.sprites[sname];

            if (r == Script.Undefined)
            {
                return;
            }

            this.texture.draw(sb, r.ToRect(), rect, c);
        }
コード例 #3
0
        public void drawChar(spriteBatcher sb, string cname, spriteRect rect, spriteColor c = null, spriteColor colorBorder = null)
        {
            var r = this.cmap[cname];

            if (r == Script.Undefined)
            {
                return;
            }
            if (c == null)
            {
                c = spriteColor.white;
            }
            if (colorBorder == null)
            {
                colorBorder = new spriteColor(0f, 0f, 0f, 0.5f);
            }
            {
                var p = this.pointbuf[0];
                p.x  = rect.x; p.y = rect.y; p.z = 0;
                p.u  = r.x; p.v = r.y;
                p.r  = c.r; p.g = c.g; p.b = c.b; p.a = c.a;
                p.r2 = colorBorder.r; p.g2 = colorBorder.g; p.b2 = colorBorder.b; p.a2 = colorBorder.a;

                p    = this.pointbuf[1];
                p.x  = rect.x + rect.w; p.y = rect.y; p.z = 0;
                p.u  = r.x + r.w; p.v = r.y;
                p.r  = c.r; p.g = c.g; p.b = c.b; p.a = c.a;
                p.r2 = colorBorder.r; p.g2 = colorBorder.g; p.b2 = colorBorder.b; p.a2 = colorBorder.a;

                p    = this.pointbuf[2];
                p.x  = rect.x; p.y = rect.y + rect.h; p.z = 0;
                p.u  = r.x; p.v = r.y + r.h;
                p.r  = c.r; p.g = c.g; p.b = c.b; p.a = c.a;
                p.r2 = colorBorder.r; p.g2 = colorBorder.g; p.b2 = colorBorder.b; p.a2 = colorBorder.a;

                p    = this.pointbuf[3];
                p.x  = rect.x + rect.w; p.y = rect.y + rect.h; p.z = 0;
                p.u  = r.x + r.w; p.v = r.y + r.h;
                p.r  = c.r; p.g = c.g; p.b = c.b; p.a = c.a;
                p.r2 = colorBorder.r; p.g2 = colorBorder.g; p.b2 = colorBorder.b; p.a2 = colorBorder.a;
            }
            sb.setMat(this.mat);
            sb.addRect(this.pointbuf);
        }
コード例 #4
0
        public void draw(spriteBatcher sb, charinfo r, spriteRect rect, spriteColor c = null, spriteColor colorBorder = null)
        {
            if (c == null)
            {
                c = spriteColor.white;
            }
            if (colorBorder == null)
            {
                colorBorder = new spriteColor(0f, 0f, 0f, 0.5f);
            }
            //if (r==null)
            {
                var p = this.pointbuf[0];
                p.x  = rect.x; p.y = rect.y + rect.h; p.z = 0;
                p.u  = r.x; p.v = r.y + r.h;
                p.r  = c.r; p.g = c.g; p.b = c.b; p.a = c.a;
                p.r2 = colorBorder.r; p.g2 = colorBorder.g; p.b2 = colorBorder.b; p.a2 = colorBorder.a;

                p    = this.pointbuf[1];
                p.x  = rect.x + rect.w; p.y = rect.y + rect.h; p.z = 0;
                p.u  = r.x + r.w; p.v = r.y + r.h;
                p.r  = c.r; p.g = c.g; p.b = c.b; p.a = c.a;
                p.r2 = colorBorder.r; p.g2 = colorBorder.g; p.b2 = colorBorder.b; p.a2 = colorBorder.a;

                p    = this.pointbuf[2];
                p.x  = rect.x; p.y = rect.y; p.z = 0;
                p.u  = r.x; p.v = r.y;
                p.r  = c.r; p.g = c.g; p.b = c.b; p.a = c.a;
                p.r2 = colorBorder.r; p.g2 = colorBorder.g; p.b2 = colorBorder.b; p.a2 = colorBorder.a;

                p    = this.pointbuf[3];
                p.x  = rect.x + rect.w; p.y = rect.y; p.z = 0;
                p.u  = r.x + r.w; p.v = r.y;
                p.r  = c.r; p.g = c.g; p.b = c.b; p.a = c.a;
                p.r2 = colorBorder.r; p.g2 = colorBorder.g; p.b2 = colorBorder.b; p.a2 = colorBorder.a;
            }
            sb.setMat(this.mat);
            sb.addRect(this.pointbuf);
        }