Working on elements
This commit is contained in:
parent
946fd79e37
commit
b7cd7a3eda
9
init.lua
9
init.lua
@ -897,6 +897,7 @@ function gui:newTextBox(txt, x, y, w, h, sx, sy, sw, sh)
|
|||||||
return c
|
return c
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function textBoxThread()
|
||||||
updater:newThread("Textbox Handler", function()
|
updater:newThread("Textbox Handler", function()
|
||||||
while true do
|
while true do
|
||||||
-- Do nothing if we aren't dealing with a textbox
|
-- Do nothing if we aren't dealing with a textbox
|
||||||
@ -907,7 +908,9 @@ updater:newThread("Textbox Handler", function()
|
|||||||
ref.bar_show = false
|
ref.bar_show = false
|
||||||
thread.sleep(.5)
|
thread.sleep(.5)
|
||||||
end
|
end
|
||||||
end)
|
end).OnError(textBoxThread)
|
||||||
|
end
|
||||||
|
textBoxThread()
|
||||||
|
|
||||||
local function insert(obj, n_text)
|
local function insert(obj, n_text)
|
||||||
if obj:HasSelection() then
|
if obj:HasSelection() then
|
||||||
@ -1020,6 +1023,7 @@ function gui:newImageBase(typ, x, y, w, h, sx, sy, sw, sh)
|
|||||||
c.setImage = function(self, i, x, y, w, h)
|
c.setImage = function(self, i, x, y, w, h)
|
||||||
if i == nil then return end
|
if i == nil then return end
|
||||||
load_image(i).OnReturn(function(img)
|
load_image(i).OnReturn(function(img)
|
||||||
|
print("The image: ",img)
|
||||||
img = love.graphics.newImage(img)
|
img = love.graphics.newImage(img)
|
||||||
IMAGE = i
|
IMAGE = i
|
||||||
if type(i) == "string" then i = image_cache[i] or i end
|
if type(i) == "string" then i = image_cache[i] or i end
|
||||||
@ -1181,12 +1185,15 @@ local drawtypes = {
|
|||||||
end,
|
end,
|
||||||
[4] = function(child, x, y, w, h)
|
[4] = function(child, x, y, w, h)
|
||||||
if child.bar_show then
|
if child.bar_show then
|
||||||
|
local lw = love.graphics.getLineWidth()
|
||||||
|
love.graphics.setLineWidth(1)
|
||||||
local font = child.font
|
local font = child.font
|
||||||
local fh = font:getHeight()
|
local fh = font:getHeight()
|
||||||
local fw = font:getWidth(child.text:sub(1, child.cur_pos))
|
local fw = font:getWidth(child.text:sub(1, child.cur_pos))
|
||||||
love.graphics.line(child.textOffsetX + child.adjust + x + fw, y + 4,
|
love.graphics.line(child.textOffsetX + child.adjust + x + fw, y + 4,
|
||||||
child.textOffsetX + child.adjust + x + fw,
|
child.textOffsetX + child.adjust + x + fw,
|
||||||
y + fh - 2)
|
y + fh - 2)
|
||||||
|
love.graphics.setLineWidth(lw)
|
||||||
end
|
end
|
||||||
if child:HasSelection() then
|
if child:HasSelection() then
|
||||||
local blue = color.highlighter_blue
|
local blue = color.highlighter_blue
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user