Page 40 of 41

Re: Löve Frames - A GUI Library

Posted: Tue Apr 28, 2020 3:10 pm
by linux-man
Cursor is behaving again.

Re: Löve Frames - A GUI Library

Posted: Wed May 06, 2020 9:09 am
by AlexYeCu
>Cursor is behaving again.

This fix is not about tooltip, right?

Re: Löve Frames - A GUI Library

Posted: Wed May 06, 2020 10:20 am
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.

Re: Löve Frames - A GUI Library

Posted: Wed May 06, 2020 6:37 pm
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;

Re: Löve Frames - A GUI Library

Posted: Thu May 07, 2020 12:19 pm
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.

Re: Löve Frames - A GUI Library

Posted: Fri May 08, 2020 3:36 am
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.

Re: Löve Frames - A GUI Library

Posted: Fri May 08, 2020 11:46 pm
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.

Re: Löve Frames - A GUI Library

Posted: Sat May 09, 2020 3:08 am
by AlexYeCu
It works!
used an ugly hack
Best style of coding ever.

Re: Löve Frames - A GUI Library

Posted: Mon May 18, 2020 5:14 pm
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».

Re: Löve Frames - A GUI Library

Posted: Mon May 18, 2020 7:36 pm
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