Пример #1
0
 public void atext(String text, Coord c, double ax, double ay) {
   Text t = Text.render(text);
   Tex T = t.tex();
   Coord sz = t.sz();
   image(T, c.add((int) ((double) sz.x * -ax), (int) ((double) sz.y * -ay)));
   T.dispose();
   checkerr();
 }
Пример #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();
 }
Пример #3
0
 /* Draw texture at c, with the extra state s applied. */
 public void image(Tex tex, Coord c, GLState s) {
   st.set(cur2d);
   if (s != null) state(s);
   tex.crender(this, c.add(tx), ul, sz);
   checkerr();
 }
Пример #4
0
 public void rimage(Tex tex, Coord c, Coord sz) {
   Coord cc = new Coord();
   for (cc.y = c.y; cc.y < c.y + sz.y; cc.y += tex.sz().y) {
     for (cc.x = c.x; cc.x < c.x + sz.x; cc.x += tex.sz().x) image(tex, cc, c, sz);
   }
 }
Пример #5
0
 public void rimageh(Tex tex, Coord c, int w) {
   Coord cc = new Coord(c);
   Coord sz = new Coord(w, tex.sz().y);
   for (; cc.x < c.x + w; cc.x += tex.sz().x) image(tex, cc, c, sz);
 }
Пример #6
0
 public void rimagev(Tex tex, Coord c, int h) {
   Coord cc = new Coord(c);
   Coord sz = new Coord(tex.sz().x, h);
   for (; cc.y < c.y + h; cc.y += tex.sz().y) image(tex, cc, c, sz);
 }
Пример #7
0
 /* Draw texture at c, scaling it to sz. */
 public void image(Tex tex, Coord c, Coord sz) {
   if (tex == null) return;
   st.set(cur2d);
   tex.crender(this, c.add(tx), ul, this.sz, sz);
   checkerr();
 }
Пример #8
0
 public void aimage(Tex tex, Coord c, double ax, double ay) {
   Coord sz = tex.sz();
   image(tex, c.add((int) ((double) sz.x * -ax), (int) ((double) sz.y * -ay)));
 }
Пример #9
0
 public void image(BufferedImage img, Coord c) {
   if (img == null) return;
   Tex tex = new TexI(img);
   image(tex, c);
   tex.dispose();
 }