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 »

Cursor is behaving again.
Attachments
loveframes_pre11.3.zip
(148.61 KiB) Downloaded 361 times
AlexYeCu
Citizen
Posts: 53
Joined: Fri May 30, 2014 4:08 pm

Re: Löve Frames - A GUI Library

Post by AlexYeCu »

>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 »

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
Citizen
Posts: 53
Joined: Fri May 30, 2014 4:08 pm

Re: Löve Frames - A GUI Library

Post by AlexYeCu »

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 »

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 348 times
AlexYeCu
Citizen
Posts: 53
Joined: Fri May 30, 2014 4:08 pm

Re: Löve Frames - A GUI Library

Post by AlexYeCu »

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 350 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 »

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 338 times
AlexYeCu
Citizen
Posts: 53
Joined: Fri May 30, 2014 4:08 pm

Re: Löve Frames - A GUI Library

Post by AlexYeCu »

It works!
used an ugly hack
Best style of coding ever.
AlexYeCu
Citizen
Posts: 53
Joined: Fri May 30, 2014 4:08 pm

Re: Löve Frames - A GUI Library

Post by AlexYeCu »

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 »

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 303 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests