示例#1
0
 public GOut reclip(Coord ul, Coord sz) {
   GOut g = new GOut(this);
   g.tx = this.tx.add(ul);
   g.ul = new Coord(g.tx);
   Coord gbr = g.ul.add(sz), tbr = this.ul.add(this.sz);
   if (g.ul.x < this.ul.x) g.ul.x = this.ul.x;
   if (g.ul.y < this.ul.y) g.ul.y = this.ul.y;
   if (gbr.x > tbr.x) gbr.x = tbr.x;
   if (gbr.y > tbr.y) gbr.y = tbr.y;
   g.sz = gbr.sub(g.ul);
   return (g);
 }
示例#2
0
 /* Draw texture at c, clipping everything outside ul to ul + sz. */
 public void image(Tex tex, Coord c, Coord ul, Coord sz) {
   if (tex == null) return;
   st.set(cur2d);
   ul = ul.add(this.tx);
   Coord br = ul.add(sz);
   if (ul.x < this.ul.x) ul.x = this.ul.x;
   if (ul.y < this.ul.y) ul.y = this.ul.y;
   if (br.x > this.ul.x + this.sz.x) br.x = this.ul.x + this.sz.x;
   if (br.y > this.ul.y + this.sz.y) br.y = this.ul.y + this.sz.y;
   tex.crender(this, c.add(this.tx), ul, br.sub(ul));
   checkerr();
 }