theme doc fix
This commit is contained in:
parent
5fd50b61f9
commit
63ce58f510
|
@ -9,51 +9,60 @@
|
|||
Для этого, используются следующие функции:
|
||||
<code lua>
|
||||
-- настройка окна вывода
|
||||
win.geom(x, y, w, h)
|
||||
win.color(fg, link, alink)
|
||||
win.font(name, size, height)
|
||||
win.gfx.up(pic, x, y)
|
||||
win.gfx.down(pic, x, y)
|
||||
theme.win.geom(x, y, w, h)
|
||||
theme.win.color(fg, link, alink)
|
||||
theme.win.font(name, size, height)
|
||||
theme.win.gfx.up(pic, x, y)
|
||||
theme.win.gfx.down(pic, x, y)
|
||||
|
||||
-- настройка инвентаря
|
||||
inv.geom(x, y, w, h)
|
||||
inv.color(fg, link, alink)
|
||||
inv.font(name, size, height)
|
||||
inv.gfx.up(pic, x, y)
|
||||
inv.gfx.down(pic, x, y)
|
||||
inv.mode(mode)
|
||||
theme.inv.geom(x, y, w, h)
|
||||
theme.inv.color(fg, link, alink)
|
||||
theme.inv.font(name, size, height)
|
||||
theme.inv.gfx.up(pic, x, y)
|
||||
theme.inv.gfx.down(pic, x, y)
|
||||
theme.inv.mode(mode)
|
||||
|
||||
-- настройка меню
|
||||
menu.bw(w)
|
||||
menu.color(fg, link, alink)
|
||||
menu.font(name, size, height)
|
||||
menu.gfx.button(pic, x, y)
|
||||
theme.menu.bw(w)
|
||||
theme.menu.color(fg, link, alink)
|
||||
theme.menu.font(name, size, height)
|
||||
theme.menu.gfx.button(pic, x, y)
|
||||
|
||||
-- настройка графики
|
||||
gfx.cursor(norm, use, x, y)
|
||||
gfx.mode(mode)
|
||||
gfx.pad(pad)
|
||||
gfx.bg(bg)
|
||||
theme.gfx.cursor(norm, use, x, y)
|
||||
theme.gfx.mode(mode)
|
||||
theme.gfx.pad(pad)
|
||||
theme.gfx.bg(bg)
|
||||
|
||||
-- настройка звука
|
||||
snd.click(name);
|
||||
theme.snd.click(name);
|
||||
</code>
|
||||
|
||||
Если необходимо изменить только часть параметров, в качестве неизменяемых параметров можно указывать значение nil. Например:
|
||||
<code lua>
|
||||
win.font(nil, 64);
|
||||
theme.win.font(nil, 64);
|
||||
</code>
|
||||
|
||||
Существует возможность чтения текущих параметров тем:
|
||||
<code lua>
|
||||
theme.get 'имя переменной темы';
|
||||
</code>
|
||||
|
||||
Начиная с версии INSTEAD 1.4.0 вы можете сбросить значение параметра темы на то, которое было установлено во встроенной теме игры:
|
||||
|
||||
<code lua>
|
||||
theme.reset 'имя переменной';
|
||||
theme.win.reset();
|
||||
-- ...
|
||||
</code>
|
||||
|
||||
===== Примеры использования =====
|
||||
|
||||
<code lua>
|
||||
gfx.bg "dramatic_bg.png";
|
||||
win.geom (0,0, theme.get 'scr.w', theme.get 'scr.h');
|
||||
inv.mode 'disabled'
|
||||
theme.gfx.bg "dramatic_bg.png";
|
||||
theme.win.geom (0,0, theme.get 'scr.w', theme.get 'scr.h');
|
||||
theme.inv.mode 'disabled'
|
||||
</code>
|
||||
|
||||
|
||||
|
|
Reference in a new issue