- Joined
- Mar 21, 2011
- Messages
- 1,611
I encountered a problem and i'm a bit confused why that's the case.
This will always work, it will always show the Floating Text of the item on the screen
This however, will only work if i get the item the first time. the second time i get the same item, and it will stack up, it won't show the text anymore.
This will always work, it will always show the Floating Text of the item on the screen
JASS:
set Item = CreateItem(ItemType[GetRandomInt(1, 4)], 0, 0)
call FloatingText("|cffFF7000" + GetItemName(Item), p)
call UnitAddItem(u, Item)
set Item = null
This however, will only work if i get the item the first time. the second time i get the same item, and it will stack up, it won't show the text anymore.
JASS:
set Item = CreateItem(ItemType[GetRandomInt(1, 4)], 0, 0)
call UnitAddItem(u, Item)
call FloatingText("|cffFF7000" + GetItemName(Item), p)
set Item = null
JASS:
function FloatingText takes string s, player p returns nothing
local texttag t = CreateTextTag()
local real r = GetRandomReal(1.00, 360.0)
local real x = GetCameraTargetPositionX()
local real y = GetCameraTargetPositionY()
call SetTextTagText(t, s, 0.0345)
call SetTextTagPos(t, x, y, 100)
if (GetLocalPlayer() != p) then
call SetTextTagVisibility(t, false)
endif
call SetTextTagVelocity(t, 0.044375*Cos(r*bj_DEGTORAD), 0.044375*Sin(r*bj_DEGTORAD))
call SetTextTagPermanent(t, false)
call SetTextTagLifespan(t, 3.00)
call SetTextTagFadepoint(t, 2.00)
set t = null
endfunction