Skip to content
Snippets Groups Projects
Commit 83b4949d authored by dg's avatar dg
Browse files

textbox

git-svn-id: http://svn.net-core.org/repos/t-engine4@2874 51575b47-30f0-44d4-a5cc-537603b46e54
parent 59cafa63
No related branches found
No related tags found
No related merge requests found
Showing with 8 additions and 6 deletions
game/engines/default/data/gfx/ui/textbox-sel1.png

305 B

game/engines/default/data/gfx/ui/textbox-sel2.png

212 B

game/engines/default/data/gfx/ui/textbox-sel3.png

282 B

game/engines/default/data/gfx/ui/textbox-sel4.png

238 B

game/engines/default/data/gfx/ui/textbox-sel5.png

166 B

game/engines/default/data/gfx/ui/textbox-sel6.png

203 B

game/engines/default/data/gfx/ui/textbox-sel7.png

309 B

game/engines/default/data/gfx/ui/textbox-sel8.png

230 B

game/engines/default/data/gfx/ui/textbox-sel9.png

320 B

......@@ -55,6 +55,7 @@ function _M:generate()
self.texcursor = self:getTexture("ui/textbox-cursor.png")
self.frame = self:makeFrame("ui/textbox", frame_w, self.h)
self.frame_sel = self:makeFrame("ui/textbox-sel", frame_w, self.h)
local w, h = self.w, self.h
local fw, fh = frame_w - 12, self.font_h
......@@ -150,13 +151,13 @@ end
function _M:display(x, y, nb_keyframes)
self.tex:toScreenFull(x, y, self.title_w, self.h, self.tex_w, self.tex_h)
self:drawFrame(self.frame, x + self.title_w, y)
if self.focused then
-- self:drawFrame(self.frame, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
self:drawFrame(self.frame_sel, x + self.title_w, y)
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)
else
self:drawFrame(self.frame, x + self.title_w, y)
if self.focus_decay then
-- self:drawFrame(self.frame, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
self:drawFrame(self.frame_sel, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
self.focus_decay = self.focus_decay - nb_keyframes
if self.focus_decay <= 0 then self.focus_decay = nil end
end
......
......@@ -54,6 +54,7 @@ function _M:generate()
self.texcursor = self:getTexture("ui/textbox-cursor.png")
self.frame = self:makeFrame("ui/textbox", frame_w, self.h)
self.frame_sel = self:makeFrame("ui/textbox-sel", frame_w, self.h)
local w, h = self.w, self.h
local fw, fh = frame_w - 12, self.font_h
......@@ -135,13 +136,13 @@ end
function _M:display(x, y, nb_keyframes)
self.tex:toScreenFull(x, y, self.title_w, self.h, self.tex_w, self.tex_h)
self:drawFrame(self.frame, x + self.title_w, y)
if self.focused then
-- self:drawFrame(self.frame, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
self:drawFrame(self.frame_sel, x + self.title_w, y)
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)
else
self:drawFrame(self.frame, x + self.title_w, y)
if self.focus_decay then
-- self:drawFrame(self.frame, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
self:drawFrame(self.frame_sel, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
self.focus_decay = self.focus_decay - nb_keyframes
if self.focus_decay <= 0 then self.focus_decay = nil end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment