Löve Frames - A GUI Library

Showcase your libraries, tools and other projects that help your fellow love users.
linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

Re: Löve Frames - A GUI Library

Post by linux-man » Tue Apr 28, 2020 3:10 pm

Cursor is behaving again.
Attachments
loveframes_pre11.3.zip
(148.61 KiB) Downloaded 72 times

AlexYeCu
Prole
Posts: 45
Joined: Fri May 30, 2014 4:08 pm

Re: Löve Frames - A GUI Library

Post by AlexYeCu » Wed May 06, 2020 9:09 am

>Cursor is behaving again.

This fix is not about tooltip, right?

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

Re: Löve Frames - A GUI Library

Post by linux-man » Wed May 06, 2020 10:20 am

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.

AlexYeCu
Prole
Posts: 45
Joined: Fri May 30, 2014 4:08 pm

Re: Löve Frames - A GUI Library

Post by AlexYeCu » Wed May 06, 2020 6:37 pm

linux-man wrote:
Wed May 06, 2020 10:20 am
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.
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;

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

Re: Löve Frames - A GUI Library

Post by linux-man » Thu May 07, 2020 12:19 pm

Maybe. Right now I'm feeling a little dumb :3 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.
Attachments
tooltip.love
(363.08 KiB) Downloaded 60 times

AlexYeCu
Prole
Posts: 45
Joined: Fri May 30, 2014 4:08 pm

Re: Löve Frames - A GUI Library

Post by AlexYeCu » Fri May 08, 2020 3:36 am

So, please try this .love and tell me what is not working with you.
Looks like the problem is with "\n" symbol.
Watch the *.love file. It works fine without "\n" and does not with.
Attachments
tootltip.love
(375.67 KiB) Downloaded 66 times

linux-man
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

Re: Löve Frames - A GUI Library

Post by linux-man » Fri May 08, 2020 11:46 pm

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.
Attachments
tooltip.love
(371.04 KiB) Downloaded 63 times

AlexYeCu
Prole
Posts: 45
Joined: Fri May 30, 2014 4:08 pm

Re: Löve Frames - A GUI Library

Post by AlexYeCu » Sat May 09, 2020 3:08 am

It works!
used an ugly hack
Best style of coding ever.

AlexYeCu
Prole
Posts: 45
Joined: Fri May 30, 2014 4:08 pm

Re: Löve Frames - A GUI Library

Post by AlexYeCu » Mon May 18, 2020 5:14 pm

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
Citizen
Posts: 67
Joined: Thu Apr 28, 2011 4:51 pm

Re: Löve Frames - A GUI Library

Post by linux-man » Mon May 18, 2020 7:36 pm

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:

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 43 times

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests