Вход
Последние темы
С праздником!!
Ср Фев 23, 2011 8:14 pm автор АНАРХИЯ
С праздником вас народ, пусть для вас небо будет чистым и удача всегда чтобы сопровождала вас!! С праздником ещё раз.
Комментарии: 2
Выводим часы на HUD
Страница 1 из 1
Выводим часы на HUD
Для этого нам понадобятся файлы: config/ui/ui_custom_msgs.xml и scripts/bind_stalker.script.
1. Создаём файл ваше_название_скрипта.script в папке gamedata/scripts и пишем в него:
function show_time()
local hud = get_hud()
local cs = hud:GetCustomStatic("hud_show_time")
if cs == nil then
hud:AddCustomStatic("hud_time_static", true)
hud:AddCustomStatic("hud_show_time", true)
cs = hud:GetCustomStatic("hud_show_time")
end
local time_h = level.get_time_hours()
local time_m = level.get_time_minutes()
local msg
if time_m >= 10 then
msg = string.format(" %02d:%02d\n", time_h, time_m)
else
msg = string.format(" %02d:%02d\n", time_h, time_m)
end
if cs ~= nil then cs:wnd():SetText(msg) end
end
2. Далее открываем файл ui_custom_msgs.xml в config/ui/ и пишем туда:
<hud_time_static x="852" y="17" width="156" height="52">
<text complex_mode="0" x="65" y="0" font="letterica16" r="255" g="255" b="255" a="130">Time</text>
<texture>ui_hud_frame_clock</texture>
</hud_time_static>
<hud_show_time x="862" y="38" width="156" height="52">
<text x="0" y="0" font="graffiti19" r="255" g="255" b="255" a="140" align="c"/>
</hud_show_time>
3. Открываем файл bind_stalker.script и пишем после:
function actor_binder:update(delta)
object_binder.update(self, delta)
local time = time_global()
game_stats.update (delta, self.object)
ваше_название_скрипта.show_time()
Автор: steelrat
1. Создаём файл ваше_название_скрипта.script в папке gamedata/scripts и пишем в него:
function show_time()
local hud = get_hud()
local cs = hud:GetCustomStatic("hud_show_time")
if cs == nil then
hud:AddCustomStatic("hud_time_static", true)
hud:AddCustomStatic("hud_show_time", true)
cs = hud:GetCustomStatic("hud_show_time")
end
local time_h = level.get_time_hours()
local time_m = level.get_time_minutes()
local msg
if time_m >= 10 then
msg = string.format(" %02d:%02d\n", time_h, time_m)
else
msg = string.format(" %02d:%02d\n", time_h, time_m)
end
if cs ~= nil then cs:wnd():SetText(msg) end
end
2. Далее открываем файл ui_custom_msgs.xml в config/ui/ и пишем туда:
<hud_time_static x="852" y="17" width="156" height="52">
<text complex_mode="0" x="65" y="0" font="letterica16" r="255" g="255" b="255" a="130">Time</text>
<texture>ui_hud_frame_clock</texture>
</hud_time_static>
<hud_show_time x="862" y="38" width="156" height="52">
<text x="0" y="0" font="graffiti19" r="255" g="255" b="255" a="140" align="c"/>
</hud_show_time>
3. Открываем файл bind_stalker.script и пишем после:
function actor_binder:update(delta)
object_binder.update(self, delta)
local time = time_global()
game_stats.update (delta, self.object)
ваше_название_скрипта.show_time()
Автор: steelrat
Страница 1 из 1
Права доступа к этому форуму:
Вы не можете отвечать на сообщения
|
|
Чт Авг 04, 2011 6:12 pm автор Гость
» Viagra Generico. fegato viagra generico
Чт Авг 04, 2011 2:26 pm автор Гость
» Acquisto Viagra. viagra generico acquisto on line per
Чт Авг 04, 2011 6:54 am автор Гость
» bbw porn ics
Ср Авг 03, 2011 3:42 pm автор Гость
» Левитра Харьков
Ср Авг 03, 2011 2:04 am автор Гость
» В Какой Аптеке Купить Курьер Женская Виагра
Вт Авг 02, 2011 9:02 pm автор Гость
» Cамые смешные анекдоты
Пн Авг 01, 2011 6:14 pm автор Гость
» Всё о диетах со всего мира!
Вс Июл 31, 2011 9:16 am автор Гость
» backlink solutions backlinks services
Вс Июл 31, 2011 3:09 am автор Гость