From 63ce58f510ef28bb36c6423fd66380ef3de2dfe3 Mon Sep 17 00:00:00 2001 From: "p.kosyh@gmail.com"
-- настройка окна вывода
-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);
Если необходимо изменить только часть параметров, в качестве неизменяемых параметров можно указывать значение nil. Например:
-win.font(nil, 64);
+theme.win.font(nil, 64);
Существует возможность чтения текущих параметров тем:
theme.get 'имя переменной темы';
+
+Начиная с версии INSTEAD 1.4.0 вы можете сбросить значение параметра темы на то, которое было установлено во встроенной теме игры:
+
+
+theme.reset 'имя переменной';
+theme.win.reset();
+-- ...
+
+
===== Примеры использования =====
-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'