comparison mde/gui/renderer/IRenderer.d @ 100:0ea4a3e651ae

There is now a position marker for text editing. Changed the way fonts are configured. Actually, not much of the new way exists yet.
author Diggory Hardy <diggory.hardy@gmail.com>
date Sat, 15 Nov 2008 17:39:14 +0000
parents 5de5810e3516
children 42e241e7be3e
comparison
equal deleted inserted replaced
99:5de5810e3516 100:0ea4a3e651ae
93 } 93 }
94 94
95 void setColour (int col = 0xFFFFFF) { 95 void setColour (int col = 0xFFFFFF) {
96 colour = Colour (col); 96 colour = Colour (col);
97 } 97 }
98
99 void setIndex (size_t index = size_t.max) {
100 this.index = index;
101 }
98 102
99 void getDimensions (out wdsize w, out wdsize h) { 103 void getDimensions (out wdsize w, out wdsize h) {
100 font.updateBlock (content, textCache); 104 font.updateBlock (content, textCache);
101 w = cast(wdim) textCache.w; 105 w = cast(wdim) textCache.w;
102 h = cast(wdim) textCache.h; 106 h = cast(wdim) textCache.h;
103 } 107 }
104 108
105 void draw (wdabs x, wdabs y) { 109 void draw (wdabs x, wdabs y) {
106 font.textBlock (x,y, content, textCache, colour); 110 font.textBlock (x,y, content, textCache, colour, index);
107 } 111 }
108 112
109 char[] content; 113 char[] content;
110 TextBlock textCache; 114 TextBlock textCache;
115 size_t index;
111 Colour colour; 116 Colour colour;
112 FontStyle font; 117 FontStyle font;
113 } 118 }
114 //END Types 119 //END Types
115 120