- Joined
- Aug 31, 2008
- Messages
- 22
Hi everyone.
I decided to move from GUI to JASS and created these little functions :
JassHelper tells me that everything is ok... but ... i dont know how to call my function ... i tried to write :
(on a new trigger with the event : A player types "test")
But it doesnt work. The text "newunit!" doesnt appear.
Can someone help me please ?
Thanks.
I decided to move from GUI to JASS and created these little functions :
JASS:
function ColorRed takes string color returns real
local real r
if color=="red" then
set r = 255
else
set r = 0
endif
return r
endfunction
function ColorGreen takes string color returns real
local real g
if color=="green" then
set g = 255
else
set g = 0
endif
return g
endfunction
function ColorBlue takes string color returns real
local real b
if color=="blue" then
set b = 255
else
set b = 0
endif
return b
endfunction
function CustomText takes string text, location pos, real dura, string color returns nothing
local texttag tag = CreateTextTag()
local real red = 0
local real green = 0
local real blue = 0
local string s
set red = ColorRed( color )
set green = ColorGreen( color )
set blue = ColorBlue( color )
set s = text + "!"
call SetTextTagText(tag, s, 10)
call SetTextTagPos(tag, GetLocationX(pos), GetLocationY(pos), 0)
call SetTextTagVelocity(tag, 64.00, 90)
call SetTextTagColorBJ(tag, red, green, blue, 0)
call SetTextTagFadepoint(tag, dura - 0.25)
call SetTextTagLifespan(tag, dura)
call SetTextTagPermanent(tag, false)
set tag = null
endfunction
JassHelper tells me that everything is ok... but ... i dont know how to call my function ... i tried to write :
JASS:
local string t = "newunit"
local string col = "green"
call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
set udg_PosTest = GetUnitLoc(GetLastCreatedUnit())
call CustomText( t, udg_PosTest, 2, col)
call RemoveLocation( udg_PosTest )
(on a new trigger with the event : A player types "test")
But it doesnt work. The text "newunit!" doesnt appear.
Can someone help me please ?
Thanks.