Added scrollableFrame example
Fixed Cursor Bug Reworked XML
This commit is contained in:
@@ -196,6 +196,10 @@ function Input:render()
|
||||
return
|
||||
end
|
||||
|
||||
if(focused) then
|
||||
self:setCursor(self.get("cursorPos") - viewOffset, 1, true, self.get("cursorColor") or self.get("foreground"))
|
||||
end
|
||||
|
||||
local visibleText = text:sub(viewOffset + 1, viewOffset + width)
|
||||
self:textFg(1, 1, visibleText, self.get("foreground"))
|
||||
end
|
||||
|
||||
@@ -410,6 +410,10 @@ end
|
||||
function VisualElement:setCursor(x, y, blink, color)
|
||||
if self.parent then
|
||||
local xPos, yPos = self:calculatePosition()
|
||||
if(x + xPos - 1<1)or(x + xPos - 1>self.parent.get("width"))or
|
||||
(y + yPos - 1<1)or(y + yPos - 1>self.parent.get("height"))then
|
||||
return self.parent:setCursor(x + xPos - 1, y + yPos - 1, false)
|
||||
end
|
||||
return self.parent:setCursor(x + xPos - 1, y + yPos - 1, blink, color)
|
||||
end
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user