-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEffectCircle.lua
37 lines (29 loc) · 880 Bytes
/
EffectCircle.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- EffectCircle
EffectCircle = Sprite:extend
{
class = "EffectCircle",
props = {"x", "y", "r", "t", "color"},
--~ width = 1,
--~ height = 1,
--~ image = nil,
color = {128,128,128,128},
t = config.AEShowTime,
dieAtTime = nil,
circleFill = nil,
onNew = function (self)
self:mixin(GameObject)
drawDebugWrapper(self)
local d = Fill:new{ alphaWithoutFog = 1, shape="circle", x = self.x-self.r, y = self.y-self.r, width = self.r*2, height = self.r*2, border = {0,0,0,0}, fill = self.color}
d:mixin(FogOfWarObject)
d.onUpdate = function (self) self:updateFogAlpha() end
the.app.view.layers.particles:add(d)
the.app.view.timer:after(self.t, function()
the.app.view.layers.particles:remove(d)
self:die()
end)
the.app.view.timer:every(0.05, function()
d.alphaWithoutFog = d.alphaWithoutFog - 0.05
end)
self.circleFill = d
end,
}