Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for i, v in pairs(data.ripples) do
- v.l = max(v.l - 5, x)
- v.t = max(v.t - 1, y)
- v.r = min(v.r + 5, x + w)
- v.b = min(v.b + 1, y + h)
- dxDrawRoundedRectangle(v.l, v.t, v.r - v.l, v.b - v.t, tocolor(0, 0, 0, 100 * v.alpha * alpha), v.lt, v.lb, v.rt, v.rb, postGUI)
- if v.l < (x + 5) and v.t < (y + 5) then v.lt = max(v.lt - 1, 0) end
- if v.r > (x + w - 5) and v.t < (y + 5) then v.rt = max(v.rt - 1, 0) end
- if v.l < (x + 5) and v.b > (y + h - 5) then v.lb = max(v.lb - 1, 0) end
- if v.r > (x + w - 5) and v.b > (y + h - 5) then v.rb = max(v.rb - 1, 0) end
- if v.l == x and v.r == x + w then
- v.alpha = max(v.alpha - 0.03, 0)
- if v.alpha == 0 then
- data.ripples[i] = nil
- end
- end
- end
- end
- end
- end
- function Buttons:onClientClickButton(button, state, x, y)
- if button == "left" and state == "down" then
- for buttonID, buttonData in pairs(self.buttons) do
- if isMouseInPosition(buttonData.x, buttonData.y, buttonData.w, buttonData.h) then
- buttonData.onClick()
- local ripple_id = #buttonData.ripples + 1
- local radius = buttonData.h / 2
- buttonData.ripples[ripple_id] = {}
- buttonData.ripples[ripple_id].alpha = 1
- buttonData.ripples[ripple_id].l = x - radius
- buttonData.ripples[ripple_id].t = y - radius
- buttonData.ripples[ripple_id].r = x + radius
- buttonData.ripples[ripple_id].b = y + radius
- buttonData.ripples[ripple_id].lt = radius
- buttonData.ripples[ripple_id].lb = radius
- buttonData.ripples[ripple_id].rt = radius
- buttonData.ripples[ripple_id].rb = radius
- break
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement