clock - escaco95/Warcraft-III-Libraries GitHub Wiki
μ ν©ν μν¬λννΈ λ²μ
1.28.5
λ§ν¬
κ°μ
κΈ°μ‘΄ jassμμ timerμ timerdialogμ ννλ‘ μ§μλμλ νμ΄λ¨Έ, νμ΄λ¨Έ μ°½ κΈ°λ₯μ νλλ‘ ν΅ν©νμ¬ κ΄λ¦¬ν μ μλ κ°μ²΄μ λλ€.
local timer t = CreateTimer()
local timerdialog td = CreateTimerDialog(t)
μ jass μ½λλ clock μΈμ€ν΄μ€λ₯Ό μ¬μ©νμ¬ λ€μκ³Ό κ°μ΄ ꡬννλ κ²μΌλ‘, λμΌν κ²°κ³Όλ¬Όμ μ»μ μ μμ΅λλ€.
local clock c = CreateClock()
λν, μ¬μ©μμ κ°λ° μ·¨ν₯μ λ§κ² struct method
μ function
μ μ¬μ©νμ¬ μΈμ€ν΄μ€λ₯Ό μ μ΄ν μ μμ΅λλ€.
//
// ν¨μ νΈμΆμ κΈ°λ°μΌλ‘ ν clock κ°μ²΄ μμ
//
scope UsingClockWithFunction initializer main
private function OnClockExpired takes nothing returns nothing
call DestroyClock( GetExpiredClock() )
endfunction
private function main takes nothing returns nothing
local clock c = CreateClock()
call ClockSetTitle( c, "μμμ νμ΄λ¨Έ μ°½ μ λͺ©" )
call StartClock( c, 20.0, false, function OnClockExpired )
call ClockDisplay( c, true ) // λλ, ShowClock( c )
endfunction
endscope
//
// λ©μλ νΈμΆμ κΈ°λ°μΌλ‘ ν clock κ°μ²΄ μμ
//
scope UsingClockWithMethod initializer main
private function OnClockExpired takes nothing returns nothing
call clock.expired.destroy() // λλ, clock.getExpired()
endfunction
private function main takes nothing returns nothing
local clock c = clock.create()
set c.title = "μμμ νμ΄λ¨Έ μ°½ μ λͺ©" // λλ, c.setTitle( "μμμ νμ΄λ¨Έ μ°½ μ λͺ©" )
call c.start( 20.0, false, function OnClockExpired )
set c.visible = true // λλ, c.display( true ), c.show()
endfunction
endscope