Added blur method to screen library & added GUI.blurredPanel widget

This commit is contained in:
IgorTimofeev
2021-07-12 11:22:57 +07:00
parent 23b463ad59
commit bf2e7f90ff
2 changed files with 114 additions and 60 deletions

View File

@@ -807,6 +807,7 @@ function GUI.panel(x, y, width, height, color, transparency)
background = color,
transparency = transparency
}
object.draw = drawPanel
return object
@@ -814,6 +815,24 @@ end
--------------------------------------------------------------------------------
local function blurredPanelDraw(object)
screen.blur(object.x, object.y, object.width, object.height, object.radius, object.color, object.transparency)
end
function GUI.blurredPanel(x, y, width, height, radius, color, transparency)
local object = GUI.object(x, y, width, height)
object.radius = radius or 3
object.color = color
object.transparency = transparency
object.draw = blurredPanelDraw
return object
end
--------------------------------------------------------------------------------
local function drawLabel(object)
local xText, yText = GUI.getAlignmentCoordinates(
object.x,
@@ -2926,7 +2945,7 @@ local function inputEventHandler(workspace, input, e1, e2, e3, e4, e5, e6, ...)
input:setCursorPosition(1)
-- End
elseif e4 == 207 then
input:setCursorPosition(unicode.len(input.text) + 1)
input:setCursorPosition(unicode.len(input.text) + 1)
else
local char = unicode.char(e3)
if not keyboard.isControl(e3) then