找回密码
 点一下
查看: 4296|回复: 0

[lucy_tse][完美滴floating text]

  [复制链接]
发表于 2006-3-28 16:00:01 | 显示全部楼层 |阅读模式


Gold Text

Floating Text - Create floating text that reads (+ + Gold) at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (100.00%, 86.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 54.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 2.00
Floating Text - Change the fadepoint of (Last created floating text) to 1.00

Lumber Text

Floating Text - Create floating text that reads (+ + Lumber) at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (0.00%, 78.00%, 31.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 54.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 2.00
Floating Text - Change the fadepoint of (Last created floating text) to 1.00

Bounty Text

Floating Text - Create floating text that reads (+ + Bounty) at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (100.00%, 86.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 54.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 3.00
Floating Text - Change the fadepoint of (Last created floating text) to 2.00

"miss" Text

Floating Text - Create floating text that reads miss at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 72.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 3.00
Floating Text - Change the fadepoint of (Last created floating text) to 1.00

Critical Strike

Floating Text - Create floating text that reads (CriticalStrike + !) at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 72.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 5.00
Floating Text - Change the fadepoint of (Last created floating text) to 2.00

Shadow Strike Text

Floating Text - Create floating text that reads ShadowStrike at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (62.00%, 100.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 72.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 5.00
Floating Text - Change the fadepoint of (Last created floating text) to 2.00

Mana Burn Text

Floating Text - Create floating text that reads ManaBurn at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (32.00%, 32.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 72.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 5.00
Floating Text - Change the fadepoint of (Last created floating text) to 2.00



偶当然米那么闲去慢慢测试,刚才这里瘫痪了,去wc3c逛看到滴

用来完美模拟像mana burn, shadow strike, critical strike之类会弹文字出来滴技能
lars
ft,他们都少了个最重要的东西啊:destroy。
看我写的floating text:
[jass]
// Create Fading Text Tag
function FadingText_Remove takes nothing returns nothing
call DestroyTextTag( HI2TextTag(GetStoredInteger(udg_CC,"FadingText",I2S(Timer2HI(GetExpiredTimer())))) )
call FlushStoredInteger(udg_CC,"FadingText",I2S(Timer2HI(GetExpiredTimer())))
call DestroyTimer(GetExpiredTimer())
endfunction
function FadingText takes player p,string msg, integer red, integer green, integer blue, real x, real y returns nothing
local texttag t=CreateTextTag()
local integer alpha=255
local timer tm=CreateTimer()
if p!=null and GetLocalPlayer()!=p then
set msg=""
set alpha=0
endif
call SetTextTagText(t,msg,0.025)
call SetTextTagPos(t,x,y, 0.00)
call SetTextTagColor(t,red,green,blue,255)
call SetTextTagVelocity(t,0,0.02)
call StoreInteger(udg_CC,"FadingText",I2S(Timer2HI(tm)),TextTag2HI(t))
call TimerStart(tm,1.5,false,function FadingText_Remove)
endfunction
[/jass]
lars
我是改的以前大家常用的那个fading text,不需要trigger和全局变量了。
下面是各个颜色代码:
  1. GoldTextColor=255,220,0
  2. LumberTextColor=0,200,80
  3. BountyTextColor=255,220,0
  4. MissTextColor=255,0,0
  5. CriticalStrikeTextColor=255,0,0
  6. ShadowStrikeTextColor=160,255,0
  7. ManaBurnTextColor=82,82,255
  8. BashTextColor=0,0,255
  9. ESPER_PALE
复制代码
贴下新s3c的FadingText函数
[jass]
function FadingText takes string msg, integer r, integer g, integer b, real x, real y, real speed, real lifespan, real fadepoint returns nothing
local texttag tt=CreateTextTag()
call SetTextTagText(tt,msg,0.025)
call SetTextTagPos(tt,x,y,0.00)
call SetTextTagColor(tt,r,g,b,255)
call SetTextTagVelocity(tt,0,speed*0.071/128)
call SetTextTagPermanent(tt,false)
call SetTextTagLifespan(tt,lifespan)
call SetTextTagFadepoint(tt,fadepoint)
call TriggerSleepAction(lifespan)
call DestroyTextTag(tt)
endfunction
[/jass]
只是想说明, 现在function(非trigger action)里面也可以用Sleep了, 只要这个函数是在trigger action里面被调用的

评分

参与人数 1威望 +6 收起 理由
alexries + 6

查看全部评分

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-4-25 07:38 , Processed in 0.128451 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表