Commit 83b4949d112fd056e643ea02b79886a827772d8d

Authored by dg
1 parent 59cafa63

textbox


git-svn-id: http://svn.net-core.org/repos/t-engine4@2874 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -55,6 +55,7 @@ function _M:generate()
55 55
56 56 self.texcursor = self:getTexture("ui/textbox-cursor.png")
57 57 self.frame = self:makeFrame("ui/textbox", frame_w, self.h)
  58 + self.frame_sel = self:makeFrame("ui/textbox-sel", frame_w, self.h)
58 59
59 60 local w, h = self.w, self.h
60 61 local fw, fh = frame_w - 12, self.font_h
... ... @@ -150,13 +151,13 @@ end
150 151
151 152 function _M:display(x, y, nb_keyframes)
152 153 self.tex:toScreenFull(x, y, self.title_w, self.h, self.tex_w, self.tex_h)
153   - self:drawFrame(self.frame, x + self.title_w, y)
154 154 if self.focused then
155   --- self:drawFrame(self.frame, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
  155 + self:drawFrame(self.frame_sel, x + self.title_w, y)
156 156 self.texcursor.t:toScreenFull(x + self.text_x + (self.cursor-self.scroll) * self.font_mono_w, y + self.cursor_y, self.texcursor.w, self.texcursor.h, self.texcursor.tw, self.texcursor.th)
157 157 else
  158 + self:drawFrame(self.frame, x + self.title_w, y)
158 159 if self.focus_decay then
159   --- self:drawFrame(self.frame, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
  160 + self:drawFrame(self.frame_sel, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
160 161 self.focus_decay = self.focus_decay - nb_keyframes
161 162 if self.focus_decay <= 0 then self.focus_decay = nil end
162 163 end
... ...
... ... @@ -54,6 +54,7 @@ function _M:generate()
54 54
55 55 self.texcursor = self:getTexture("ui/textbox-cursor.png")
56 56 self.frame = self:makeFrame("ui/textbox", frame_w, self.h)
  57 + self.frame_sel = self:makeFrame("ui/textbox-sel", frame_w, self.h)
57 58
58 59 local w, h = self.w, self.h
59 60 local fw, fh = frame_w - 12, self.font_h
... ... @@ -135,13 +136,13 @@ end
135 136
136 137 function _M:display(x, y, nb_keyframes)
137 138 self.tex:toScreenFull(x, y, self.title_w, self.h, self.tex_w, self.tex_h)
138   - self:drawFrame(self.frame, x + self.title_w, y)
139 139 if self.focused then
140   --- self:drawFrame(self.frame, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
  140 + self:drawFrame(self.frame_sel, x + self.title_w, y)
141 141 self.texcursor.t:toScreenFull(x + self.text_x + (self.cursor-self.scroll) * self.font_mono_w, y + self.cursor_y, self.texcursor.w, self.texcursor.h, self.texcursor.tw, self.texcursor.th)
142 142 else
  143 + self:drawFrame(self.frame, x + self.title_w, y)
143 144 if self.focus_decay then
144   --- self:drawFrame(self.frame, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
  145 + self:drawFrame(self.frame_sel, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
145 146 self.focus_decay = self.focus_decay - nb_keyframes
146 147 if self.focus_decay <= 0 then self.focus_decay = nil end
147 148 end
... ...