Löve Frames - A GUI Library
Re: Löve Frames - A GUI Library
Cursor is behaving again.
- Attachments
-
- loveframes_pre11.3.zip
- (148.61 KiB) Downloaded 361 times
Re: Löve Frames - A GUI Library
>Cursor is behaving again.
This fix is not about tooltip, right?
This fix is not about tooltip, right?
Re: Löve Frames - A GUI Library
I don't know. The fact is tooltip works - most of the time. There are some Cyrillic characters that seems to "freeze" LoveFrames, but I can't debug it. No errors. No problems with English alphabet or even Western accented chars.
Re: Löve Frames - A GUI Library
There is no Cyrillic characters in this test. And tooltip works fine with LoveFrames (Version 0.10 - Alpha) and does not with the last one (even posted here Version 0.10 - Alpha). Once again: There is a draw function in old tooltip.lua which is not presented in new one. And it calls SetDrawOrder function. May be this is the root of the problem?
Code: Select all
loveframes = require "lib.loveframes"
--loveframes = require "lib.LoveFrames"
require 'functions.utilits';
require 'lang.translation'
if jit then
jit.on();
else
print ("No luajit detected!")
end
love.keyboard.setKeyRepeat(true);
function love.load()
local back = loveframes.Create("image");
local image = love.graphics.newImage( "background.dds" )
back:SetImage(image);
back:SetPos (0, 0)
font = love.graphics.newFont("DroidSans.ttf", 16);
local textfield = loveframes.Create("text");
textfield:SetPos(120, 120);
textfield:SetWidth(200);
textfield:SetFont(font);
textfield:SetText("test");
local tooltip = loveframes.Create("tooltip");
tooltip:SetObject(textfield);
tooltip:SetPadding(10);
tooltip:SetText("arrrrrrrrrrrrrrrrararsrasrarsar");
end;
function love.update(dt)
loveframes.update(dt);
end;
function love.keypressed(key)
loveframes.keypressed(button,true);
end
function love.keyreleased(key)
loveframes.keyreleased(button,true);
end
function love.mousepressed(x,y,button)
loveframes.mousepressed(x, y, button);
end
function love.mousereleased(x,y,button)
loveframes.mousereleased(x, y, button);
end
function love.mousemooved(x,y,dx,dy)
end
function love.wheelmoved( x, y )
end;
function love.textinput(text)
loveframes.textinput(text);
end;
function love.draw()
loveframes.draw();
end;
Re: Löve Frames - A GUI Library
Maybe. Right now I'm feeling a little dumb because after adapting your code to my system, it works.
So, please try this .love and tell me what is not working with you.
Let's exchange love files until we find out what's wrong.
So, please try this .love and tell me what is not working with you.
Let's exchange love files until we find out what's wrong.
- Attachments
-
- tooltip.love
- (363.08 KiB) Downloaded 348 times
Re: Löve Frames - A GUI Library
Looks like the problem is with "\n" symbol.So, please try this .love and tell me what is not working with you.
Watch the *.love file. It works fine without "\n" and does not with.
- Attachments
-
- tootltip.love
- (375.67 KiB) Downloaded 350 times
Re: Löve Frames - A GUI Library
I think I got it. It was the invisible "text" internal object of tooltip that was messing with the collision system.
The collision system is a little convoluted and I don't understand it well enough. I tried some simple changes that didn't work. Since I don't want to create new bugs, I didn't change anything, but used an ugly hack: invisible tooltips are positioned far away. Only tooltip code was changed, just to be sure.
The collision system is a little convoluted and I don't understand it well enough. I tried some simple changes that didn't work. Since I don't want to create new bugs, I didn't change anything, but used an ugly hack: invisible tooltips are positioned far away. Only tooltip code was changed, just to be sure.
- Attachments
-
- tooltip.love
- (371.04 KiB) Downloaded 338 times
Re: Löve Frames - A GUI Library
It works!
Best style of coding ever.used an ugly hack
Re: Löve Frames - A GUI Library
Feature request.
linux-man, could you add a possibility to call different functions pressing image button with LMB and RMB? I've made this in my project, but guess my variant is not universal and a bit «dirty».
linux-man, could you add a possibility to call different functions pressing image button with LMB and RMB? I've made this in my project, but guess my variant is not universal and a bit «dirty».
Re: Löve Frames - A GUI Library
Here is a patch, but I'm not sure to make it mainstream - there's something strange with a button right-click. Some even call it unnatural.
You can manage mouse buttons with this modified function:
You can manage mouse buttons with this modified function:
Code: Select all
imagebutton.OnClick = function(object, x, y, button)
print("The image button was clicked! With button "..button)
end
- Attachments
-
- imagebutton.lua
- (7.66 KiB) Downloaded 303 times
Who is online
Users browsing this forum: Bing [Bot] and 1 guest