Сейчас 01:46:44 Понедельник, 29 апреля, 2024 год
[ x ] Главная ⇒ Форум ⇐ RSS Файлы Cтатьи Картинки В о й т и   или   з а р е г и с т р и р о в а т ь с я


[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Модератор форума: PUVer, SirNikolas, Ty3uK  
Форум о Warcraft 3 » Раздел для картостроителей » GUI / Jass » Надпись меняющяя цвет (Из ГУИ в джасс)
Надпись меняющяя цвет
FatalBladeДата: Понедельник, 01 Августа 2011, 14:40:44 | Сообщение # 1
10 уровень
Группа: Проверенные
Сообщений: 1523
Награды: 0
Репутация: 439
Блокировки:
Code
Unleash Ready
     Events
         Time - Every 0.30 seconds of game time
     Conditions
     Actions
         Floating Text - Destroy Unleash_Ready_Text
         Floating Text - Create floating text that reads UNLEASH!!! above SufferCaster with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
         Set Unleash_Ready_Text = (Last created floating text)
         Wait 0.10 seconds
         Floating Text - Destroy Unleash_Ready_Text
         Floating Text - Create floating text that reads UNLEASH!!! above SufferCaster with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
         Set Unleash_Ready_Text = (Last created floating text)
         Wait 0.10 seconds
         Floating Text - Destroy Unleash_Ready_Text
         Floating Text - Create floating text that reads UNLEASH!!! above SufferCaster with Z offset 0.00, using font size 10.00, color (0.00%, 0.00%, 100.00%), and 0.00% transparency
         Set Unleash_Ready_Text = (Last created floating text)
         Wait 0.10 seconds
         Floating Text - Destroy Unleash_Ready_Text


Тут вообщем каждые 0.1 секунд надпись меняет цвет.
Как это сделать с таймерами в джасс?


 

HexingДата: Понедельник, 01 Августа 2011, 15:45:37 | Сообщение # 2
10 уровень
Группа: Проверенные
Сообщений: 1645
Награды: 1
Репутация: 432
Блокировки:
Сделал, с вас 5 тыщь рублей idiot
Code
if(coloredTagsPos[k] == 1) then
          call SetTextTagColor(coloredTags[k], 0, 255, 0, 100) //с красного на зеленый
       elseif(coloredTagsPos[k] == 2) then
          call SetTextTagColor(coloredTags[k], 0, 0, 255, 100) //с зеленого на синий
       else
          call SetTextTagColor(coloredTags[k], 255, 0, 0, 100) //с синего на красный
       endif
       if not(coloredTagsPos[k] == 3) then
          set coloredTagsPos[k] = coloredTagsPos[k] + 1
       else
          set coloredTagsPos[k] = 1
       endif


Ну, и собственно, пример:

Добавлено (01-08-2011, 15:45)
---------------------------------------------
итить калатить глюки
вот весь код:

Code
globals
    timer array coloredTagsTms
    texttag array coloredTags
    integer array coloredTagsPos
    integer coloredTagsNum=0
endglobals

function ColorTextTag takes nothing returns nothing
    local integer i=0
    local integer k=0
    loop
       if (coloredTagsTms[i] == GetExpiredTimer()) then
          set k = i
       endif
       set i = i+1
       exitwhen (i == coloredTagsNum)
    endloop
    if(coloredTagsPos[k] == 1) then
          call SetTextTagColor(coloredTags[k], 0, 255, 0, 100) //с красного на зеленый
       elseif(coloredTagsPos[k] == 2) then
          call SetTextTagColor(coloredTags[k], 0, 0, 255, 100) //с зеленого на синий
       else
          call SetTextTagColor(coloredTags[k], 255, 0, 0, 100) //с синего на красный
       endif
       if not(coloredTagsPos[k] == 3) then
          set coloredTagsPos[k] = coloredTagsPos[k] + 1
       else
          set coloredTagsPos[k] = 1
       endif
endfunction

function CreateColoredTextTag takes string text, real x, real y returns nothing
    set coloredTagsTms[coloredTagsNum] = CreateTimer()
    set coloredTags[coloredTagsNum] = CreateTextTag()
    set coloredTagsPos[coloredTagsNum] = 1
    local real textHeight = TextTagSize2Height(8.00) //не раскрывал, будет время - раскрой.
    call SetTextTagText(coloredTags[coloredTagsNum], text, textHeight)
    call SetTextTagPos(coloredTags[coloredTagsNum], x, y, 0)
    call SetTextTagColor(coloredTags[coloredTagsNum], 255, 0, 0, 100)
    call TimerStart(coloredTagsTms[coloredTagsNum],0.10,true,function ColorTextTag)    
    set coloredTagsNum = coloredTagsNum+1
endfunction


 

FatalBladeДата: Понедельник, 01 Августа 2011, 16:42:13 | Сообщение # 3
10 уровень
Группа: Проверенные
Сообщений: 1523
Награды: 0
Репутация: 439
Блокировки:
Спс большое

 

Форум о Warcraft 3 » Раздел для картостроителей » GUI / Jass » Надпись меняющяя цвет (Из ГУИ в джасс)
  • Страница 1 из 1
  • 1
Поиск:

Copyright © 2006 - 2024 Warcraft3FT.info При копировании материалов c сайта ставьте, пожалуйста, активную обратную ссылку на нас • Design by gReeB04ki ©
Хостинг от uCoz