Changeset 350
- Timestamp:
- 06/03/08 06:46:56 (6 months ago)
- Files:
-
- trunk/qd/SDL_ttf.d (modified) (3 diffs)
- trunk/qd/dsss.conf (modified) (1 diff)
- trunk/qd/dt.d (deleted)
- trunk/qd/dt/fatline.d (moved) (moved from trunk/qd/dt/test13.d) (1 diff)
- trunk/qd/dt/main.d (moved) (moved from trunk/qd/dt/dt.d) (2 diffs)
- trunk/qd/qd.d (modified) (2 diffs)
- trunk/qd/test13.d (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/qd/SDL_ttf.d
r345 r350 97 97 } 98 98 99 void print( int x, int y, Align how, fontsettings[] settings, string[] strings) in {99 void print(Area delegate(int w, int h) dg, fontsettings[] settings, string[] strings) in { 100 100 assert(settings.length == strings.length); 101 101 } body { … … 110 110 if (surfs[i].height > height) height = surfs[i].height; 111 111 } 112 auto target = display.select(pt(x, y), pt(width, height), how); 112 //auto target = display.select(pt(x, y), pt(width, height), how); 113 auto target = dg(width, height); 113 114 foreach (surf; surfs) { 114 115 target.blit(surf, Top|Left); … … 118 119 } 119 120 120 void print(int x, int y, Align how, rgb col, string what) { 121 fontsettings foo; foo.color = col; 122 print(x, y, how, [foo], [what]); 123 } 121 void print(int x, int y, Align how, fontsettings[] settings, string[] strings) { 122 print((int w, int h) { return display.select(pt(x, y), pt(w, h), how); }, settings, strings); 123 } 124 125 void print(Area target, Align how, rgb col, string what) { 126 fontsettings foo; foo.color = col; print((int w, int h) { return target.select(pt(w, h), how); }, [foo], [what]); 127 } 128 129 void print(Align how, fontsettings[] settings, string[] strings) { 130 print((int w, int h) { return display.select(pt(w, h), how); }, settings, strings); 131 } 132 133 void print(int x, int y, Align how, rgb col, string what) { fontsettings foo; foo.color = col; print(x, y, how, [foo], [what]); } 134 135 void print(Align how, rgb col, string what) { fontsettings foo; foo.color = col; print(how, [foo], [what]); } 124 136 125 137 void print(pt p, Align how, rgb col, string what) { print(p.x, p.y, how, col, what); } trunk/qd/dsss.conf
r343 r350 2 2 [qd.d] 3 3 type=sourcelibrary 4 [dt .d]4 [dt/dt.d] 5 5 buildflags=-L-lSDL -L-lSDL_ttf -g -O 6 6 # [test.d] trunk/qd/dt/fatline.d
r347 r350 1 module dt. test13;1 module dt.fatline; 2 2 3 3 import qd, dglut.vector, std.stdio, tools.base, tools.log, std.math; trunk/qd/dt/main.d
r347 r350 1 module dt. dt; // D Tower Defense1 module dt.main; // D Tower Defense 2 2 3 3 import tools.base; … … 505 505 } 506 506 507 import dt. test13, tools.functional;507 import dt.fatline, tools.functional; 508 508 void main() { 509 509 auto blink_fn = blink(0.5); trunk/qd/qd.d
r346 r350 607 607 void updateMouse(int x, int y, ubyte button, int pushed) { 608 608 mouse.pos = pt(x, y); 609 if (pushed == 1) mouse._clicked = true; 609 if (pushed == 1) { 610 if (button == 1) mouse._leftclicked = true; 611 if (button == 3) mouse._rightclicked = true; 612 } 610 613 } 611 614 … … 613 616 static { 614 617 pt pos; 615 bool _clicked; 616 bool clicked() { if (!_clicked) return false; _clicked = false; return true; } 618 bool _leftclicked, _rightclicked; 619 bool clicked() { if (!_leftclicked) return false; _leftclicked = false; return true; } 620 bool rightclicked() { if (!_rightclicked) return false; _rightclicked = false; return true; } 617 621 bool opIn(Area area) { 618 622 return pos in area;
