War3 触发器

| 发布     | 分类 war3  | 标签 War3  触发器  Trigger 

一:事件

image-20210217190106501

1.1 事件 - 普通

image-20210217190904489

1.1.1 事件 - 普通 - 地图初始话

image-20210217191558525

PS: 在代码中其实就是每有加任何事件,直接触发

function Trig_ZFLearn01TrigerActions takes nothing returns nothing
    call YDWEDisplayChat( Player(0), 0, "Hello World" )
endfunction

//===========================================================================
function InitTrig_ZFLearn01Triger takes nothing returns nothing
    set gg_trg_ZFLearn01Triger = CreateTrigger()
    call TriggerAddAction(gg_trg_ZFLearn01Triger, function Trig_ZFLearn01TrigerActions)
endfunction

1.2 事件 - 硬件

image-20210217191927589

1.2.1 事件 - 硬件 - 鼠标滚轮事件

image-20210217192021447

call DzTriggerRegisterMouseWheelEventTrg( gg_trg_ZFLearn01Triger )
function Trig_ZFWheelTriggerActions takes nothing returns nothing
    // 获取滚轮delta
    local integer wheelDelta =  DzGetWheelDelta()
    call YDWEDisplayChat( Player(0), 0, "滚轮 wheelDelta=" + I2S(wheelDelta) )
endfunction

//===========================================================================
function InitTrig_ZFWheelTrigger takes nothing returns nothing
    set gg_trg_ZFLearn01Triger = CreateTrigger()
    // 鼠标滚轮事件
    call DzTriggerRegisterMouseWheelEventTrg( gg_trg_ZFLearn01Triger )
    call TriggerAddAction(gg_trg_ZFLearn01Triger, function Trig_ZFWheelTriggerActions)
endfunction


image-20210217194403080

上一篇: jass 笔记
下一篇: 游戏感 笔记