Skip to content
Snippets Groups Projects
Commit 1bb8e193 authored by dg's avatar dg
Browse files

moar

git-svn-id: http://svn.net-core.org/repos/t-engine4@2849 51575b47-30f0-44d4-a5cc-537603b46e54
parent f1114c53
No related branches found
No related tags found
No related merge requests found
Showing
with 47 additions and 79 deletions
game/engines/default/data/gfx/ui/heading3.png

219 B

game/engines/default/data/gfx/ui/heading4.png

177 B

game/engines/default/data/gfx/ui/heading5.png

167 B

game/engines/default/data/gfx/ui/heading6.png

179 B

game/engines/default/data/gfx/ui/heading7.png

228 B

game/engines/default/data/gfx/ui/heading8.png

182 B

game/engines/default/data/gfx/ui/heading9.png

226 B

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

172 B | W: | H:

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

199 B | W: | H:

game/engines/default/data/gfx/ui/textbox-cursor.png
game/engines/default/data/gfx/ui/textbox-cursor.png
game/engines/default/data/gfx/ui/textbox-cursor.png
game/engines/default/data/gfx/ui/textbox-cursor.png
  • 2-up
  • Swipe
  • Onion skin
game/engines/default/data/gfx/ui/textbox1.png

300 B

game/engines/default/data/gfx/ui/textbox2.png

213 B

game/engines/default/data/gfx/ui/textbox3.png

276 B

game/engines/default/data/gfx/ui/textbox4.png

232 B

game/engines/default/data/gfx/ui/textbox5.png

166 B

game/engines/default/data/gfx/ui/textbox6.png

203 B

game/engines/default/data/gfx/ui/textbox7.png

313 B

game/engines/default/data/gfx/ui/textbox8.png

230 B

game/engines/default/data/gfx/ui/textbox9.png

326 B

......@@ -65,8 +65,8 @@ function _M:init(t)
col.frame = self:makeFrame(nil, col.width, self.fh)
col.frame_sel = self:makeFrame("ui/selector-sel", col.width, self.fh)
col.frame_usel = self:makeFrame("ui/selector", col.width, self.fh)
col.frame_col = self:makeFrame("ui/selector", col.width, self.fh)
col.frame_col_sel = self:makeFrame("ui/selector-sel", col.width, self.fh)
col.frame_col = self:makeFrame("ui/heading", col.width, self.fh)
col.frame_col_sel = self:makeFrame("ui/heading-sel", col.width, self.fh)
end
Base.init(self, t)
......@@ -245,7 +245,7 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y)
local col = self.columns[j]
local y = y
if not self.hide_columns then
if self.cur_col == j then self:drawFrame(col.frame_col_sel, x, y)
if self.cur_col == j then self:drawFrame(col.frame_col, x, y)
else self:drawFrame(col.frame_col_sel, x, y) end
col._tex:toScreenFull(x, y, col.fw, self.fh, col._tex_w, col._tex_h)
y = y + self.fh
......
......@@ -46,48 +46,34 @@ function _M:generate()
self.mouse:reset()
self.key:reset()
local ls, ls_w, ls_h = self:getImage("ui/textbox-left-sel.png")
local ms, ms_w, ms_h = self:getImage("ui/textbox-middle-sel.png")
local rs, rs_w, rs_h = self:getImage("ui/textbox-right-sel.png")
local l, l_w, l_h = self:getImage("ui/textbox-left.png")
local m, m_w, m_h = self:getImage("ui/textbox-middle.png")
local r, r_w, r_h = self:getImage("ui/textbox-right.png")
local c, c_w, c_h = self:getImage("ui/textbox-cursor.png")
self.h = r_h
-- Draw UI
local title_w = self.font:size(self.title)
self.w = title_w + self.chars * self.font_mono_w + ls_w + rs_w
local w, h = self.w, r_h
local fw, fh = w - title_w - ls_w - rs_w, self.font_h
self.title_w = title_w
local frame_w = self.chars * self.font_mono_w + 12
self.w = title_w + frame_w
self.h = self.font_h + 6
self.texcursor = self:getTexture("ui/textbox-cursor.png")
self.frame = self:makeFrame("ui/textbox", frame_w, self.h)
local w, h = self.w, self.h
local fw, fh = frame_w - 12, self.font_h
self.fw, self.fh = fw, fh
self.text_x = ls_w + title_w
self.text_x = 6 + title_w
self.text_y = (h - fh) / 2
self.cursor_y = (h - self.texcursor.h) / 2
self.max_display = math.floor(fw / self.font_mono_w)
local ss = core.display.newSurface(w, h)
local s = core.display.newSurface(w, h)
local s = core.display.newSurface(title_w, h)
self.text_surf = core.display.newSurface(fw, fh)
self.text_tex, self.text_tex_w, self.text_tex_h = s:glTexture()
self.text_tex, self.text_tex_w, self.text_tex_h = self.text_surf:glTexture()
self:updateText()
ss:merge(ls, title_w, 0)
for i = title_w + ls_w, w - rs_w do ss:merge(ms, i, 0) end
ss:merge(rs, w - rs_w, 0)
ss:drawColorStringBlended(self.font, self.title, 0, (h - fh) / 2, 255, 255, 255, true)
s:merge(l, title_w, 0)
for i = title_w + l_w, w - r_w do s:merge(m, i, 0) end
s:merge(r, w - r_w, 0)
s:erase(0, 0, 0, 0)
s:drawColorStringBlended(self.font, self.title, 0, (h - fh) / 2, 255, 255, 255, true)
local cursor = core.display.newSurface(c_w, fh)
for i = 0, fh - 1 do cursor:merge(c, 0, i) end
self.cursor_tex, self.cursor_tex_w, self.cursor_tex_h = cursor:glTexture()
self.cursor_w, self.cursor_h = c_w, fh
self.tex, self.tex_w, self.tex_h = s:glTexture()
-- Add UI controls
self.mouse:registerZone(title_w + ls_w, 0, fw, h, function(button, x, y, xrel, yrel, bx, by, event)
self.mouse:registerZone(title_w + 6, 0, fw, h, function(button, x, y, xrel, yrel, bx, by, event)
if event == "button" then
self.cursor = util.bound(math.floor(bx / self.font_mono_w) + self.scroll, 1, #self.tmp+1)
self:updateText()
......@@ -137,9 +123,6 @@ function _M:generate()
end
end,
}
self.tex, self.tex_w, self.tex_h = s:glTexture()
self.stex = ss:glTexture()
end
function _M:updateText(v)
......@@ -166,16 +149,17 @@ function _M:updateText(v)
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.stex:toScreenFull(x, y, self.w, self.h, self.tex_w, self.tex_h)
-- self:drawFrame(self.frame, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
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.tex:toScreenFull(x, y, self.w, self.h, self.tex_w, self.tex_h)
if self.focus_decay then
self.stex:toScreenFull(x, y, self.w, self.h, self.tex_w, self.tex_h, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
-- self:drawFrame(self.frame, 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
end
self.text_tex:toScreenFull(x + self.text_x, y + self.text_y, self.fw, self.fh, self.text_tex_w, self.text_tex_h)
self.cursor_tex:toScreenFull(x + self.text_x + (self.cursor-self.scroll) * self.font_mono_w, y + self.text_y, self.cursor_w, self.cursor_h, self.cursor_tex_w, self.cursor_tex_h)
end
......@@ -45,48 +45,34 @@ function _M:generate()
self.mouse:reset()
self.key:reset()
local ls, ls_w, ls_h = self:getImage("ui/textbox-left-sel.png")
local ms, ms_w, ms_h = self:getImage("ui/textbox-middle-sel.png")
local rs, rs_w, rs_h = self:getImage("ui/textbox-right-sel.png")
local l, l_w, l_h = self:getImage("ui/textbox-left.png")
local m, m_w, m_h = self:getImage("ui/textbox-middle.png")
local r, r_w, r_h = self:getImage("ui/textbox-right.png")
local c, c_w, c_h = self:getImage("ui/textbox-cursor.png")
self.h = r_h
-- Draw UI
local title_w = self.font:size(self.title)
self.w = title_w + self.chars * self.font_mono_w + ls_w + rs_w
local w, h = self.w, r_h
local fw, fh = w - title_w - ls_w - rs_w, self.font_h
self.title_w = title_w
local frame_w = self.chars * self.font_mono_w + 12
self.w = title_w + frame_w
self.h = self.font_h + 6
self.texcursor = self:getTexture("ui/textbox-cursor.png")
self.frame = self:makeFrame("ui/textbox", frame_w, self.h)
local w, h = self.w, self.h
local fw, fh = frame_w - 12, self.font_h
self.fw, self.fh = fw, fh
self.text_x = ls_w + title_w
self.text_x = 6 + title_w
self.text_y = (h - fh) / 2
self.cursor_y = (h - self.texcursor.h) / 2
self.max_display = math.floor(fw / self.font_mono_w)
local ss = core.display.newSurface(w, h)
local s = core.display.newSurface(w, h)
local s = core.display.newSurface(title_w, h)
self.text_surf = core.display.newSurface(fw, fh)
self.text_tex, self.text_tex_w, self.text_tex_h = s:glTexture()
self.text_tex, self.text_tex_w, self.text_tex_h = self.text_surf:glTexture()
self:updateText()
ss:merge(ls, title_w, 0)
for i = title_w + ls_w, w - rs_w do ss:merge(ms, i, 0) end
ss:merge(rs, w - rs_w, 0)
ss:drawColorStringBlended(self.font, self.title, 0, (h - fh) / 2, 255, 255, 255, true)
s:merge(l, title_w, 0)
for i = title_w + l_w, w - r_w do s:merge(m, i, 0) end
s:merge(r, w - r_w, 0)
s:erase(0, 0, 0, 0)
s:drawColorStringBlended(self.font, self.title, 0, (h - fh) / 2, 255, 255, 255, true)
local cursor = core.display.newSurface(c_w, fh)
for i = 0, fh - 1 do cursor:merge(c, 0, i) end
self.cursor_tex, self.cursor_tex_w, self.cursor_tex_h = cursor:glTexture()
self.cursor_w, self.cursor_h = c_w, fh
self.tex, self.tex_w, self.tex_h = s:glTexture()
-- Add UI controls
self.mouse:registerZone(title_w + ls_w, 0, fw, h, function(button, x, y, xrel, yrel, bx, by, event)
self.mouse:registerZone(title_w + 6, 0, fw, h, function(button, x, y, xrel, yrel, bx, by, event)
if event == "button" then
self.cursor = util.bound(math.floor(bx / self.font_mono_w) + self.scroll, 1, #self.tmp+1)
self:updateText()
......@@ -131,9 +117,6 @@ function _M:generate()
end
end,
}
self.tex, self.tex_w, self.tex_h = s:glTexture()
self.stex = ss:glTexture()
end
function _M:updateText()
......@@ -151,13 +134,14 @@ function _M:updateText()
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.stex:toScreenFull(x, y, self.w, self.h, self.tex_w, self.tex_h)
self.cursor_tex:toScreenFull(x + self.text_x + (self.cursor-self.scroll) * self.font_mono_w, y + self.text_y, self.cursor_w, self.cursor_h, self.cursor_tex_w, self.cursor_tex_h)
-- self:drawFrame(self.frame, x + self.title_w, y, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
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.tex:toScreenFull(x, y, self.w, self.h, self.tex_w, self.tex_h)
if self.focus_decay then
self.stex:toScreenFull(x, y, self.w, self.h, self.tex_w, self.tex_h, 1, 1, 1, self.focus_decay / self.focus_decay_max_d)
-- self:drawFrame(self.frame, 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