Page 4 of 6
Re: LOVEly Eyes (GUI Toys) update of 2009-04-28
Posted: Tue Apr 28, 2009 2:35 pm
by Robin
Naturally, you have no support for my keyboard, which makes it more broken than the previous version. Will take a look to see if I can submit the keyboard support.
On another note, for some reason, gradients don't seem to work on my Xubuntu system. Instead of the gradient fill, it's just the background. On WinXP, the gradients worked fine.
I have not tested the latest version on XP yet. Will do in a moment.
--- EDIT ---
I just tested on XP. The gradients work as expected. The dead key approach did work here, and I see what you meant by "not the correct width". The buttons worked great.
Just one tiny remark: I would find it more intuitive* if the button gradients would change only if the button is pushed, instead of changing whenever the mouse is over it. For the onmouseover gradient, I would pick either no change, or just highlighting.
*I misspelled that about ten times in a row before getting it right...
Re: LOVEly Eyes (GUI Toys) update of 2009-04-28
Posted: Tue Apr 28, 2009 8:08 pm
by athanazio
great idea about the button will change the border width in 1 point in order to highlight, I think will be enough,
and reverse the gradient only when the click happens.
aha ! will be great to have different keyboard supports !
later I will publish these changes, and the fix that I made for the keyboard
Re: LOVEly Eyes (GUI Toys) update of 2009-04-28b
Posted: Wed Apr 29, 2009 3:04 am
by athanazio
minor bug fixing
- character length in text,button,edit now can support chars from the Keyboard class
- changed button to reverse gradient only when it clicks
Re: LOVEly Eyes (GUI Toys) update of 2009-04-28b
Posted: Wed Apr 29, 2009 7:23 am
by Robin
Exellent

. However, both dead keys and gradients do not work for me on Xubuntu. I have no idea why.
Re: LOVEly Eyes (GUI Toys) update of 2009-04-28b
Posted: Wed Apr 29, 2009 9:58 am
by athanazio
hey masters of the universe any idea why the gradient dont work on Xubuntu ?
is a pretty simple code
Code: Select all
Gradient = {}
Gradient.__index = Gradient
Gradient.VERTICAL = 1
Gradient.HORIZONTAL = 2
-- create the new text object
function Gradient:new(color1,color2)
local me = {}
setmetatable(me, Gradient)
me.color1 = color1
me.color2 = color2
me.mode = Gradient.VERTICAL
return me
end
function Gradient:draw(x,y,w,h)
if self.mode == Gradient.VERTICAL then
self:vertical(x,y,w,h)
elseif self.mode == Gradient.HORIZONTAL then
self:horizontal(x,y,w,h)
end
end
-- draw the vertical gradient
function Gradient:vertical(x,y,w,h)
local currentColor = love.graphics.getColor()
local currentLine = love.graphics.getLineWidth()
love.graphics.setLineWidth(1)
love.graphics.setColor( self.color1 )
local red = self.color1:getRed()
local green = self.color1:getGreen()
local blue = self.color1:getBlue()
local x1 = x + w
local stepRed = ( self.color2:getRed() - self.color1:getRed() ) / h
local stepGreen = ( self.color2:getGreen() - self.color1:getGreen() ) / h
local stepBlue = ( self.color2:getBlue() - self.color1:getBlue() ) / h
for n=y+2, y+(h-3),1 do
love.graphics.setColor( red, green, blue )
love.graphics.line( x, n, x1, n )
red = red + stepRed
green = green + stepGreen
blue = blue + stepBlue
end
love.graphics.setColor( self.color2 )
love.graphics.line( x, y+h-2, x1, y+h-2 )
love.graphics.setColor( currentColor )
love.graphics.setLineWidth(currentLine)
end
-- draw the horizontal gradient
function Gradient:horizontal(x,y,w,h)
local currentColor = love.graphics.getColor()
local currentLine = love.graphics.getLineWidth()
love.graphics.setLineWidth(1)
love.graphics.setColor( self.color1 )
local red = self.color1:getRed()
local green = self.color1:getGreen()
local blue = self.color1:getBlue()
local y1 = y + h
local stepRed = ( self.color2:getRed() - self.color1:getRed() ) / w
local stepGreen = ( self.color2:getGreen() - self.color1:getGreen() ) / w
local stepBlue = ( self.color2:getBlue() - self.color1:getBlue() ) / w
for n=x+2, x+(w-3),1 do
love.graphics.setColor( red, green, blue )
love.graphics.line( n, y, n, y1 )
red = red + stepRed
green = green + stepGreen
blue = blue + stepBlue
end
love.graphics.setColor( self.color2 )
love.graphics.line( x+w-2, y, x+w-2, y1 )
love.graphics.setColor( currentColor )
love.graphics.setLineWidth(currentLine)
end
Re: LOVEly Eyes (GUI Toys) yes we have roundbox
Posted: Thu Apr 30, 2009 1:34 am
by athanazio
yes we have rounded boxes ...
just the polygon for now, but soon will become a Rectangle feature

- wow this is rounded.jpg (7.34 KiB) Viewed 4639 times
Re: LOVEly Eyes (GUI Toys) update of 2009-04-29
Posted: Fri May 01, 2009 1:46 pm
by farvardin

we have so many usefull GUI now, I have no excuse to make a decent game!
Re: LOVEly Eyes (GUI Toys) update of 2009-04-29
Posted: Fri May 01, 2009 2:55 pm
by athanazio
farvardin wrote:
we have so many usefull GUI now, I have no excuse to make a decent game!

Re: LOVEly Eyes (GUI Toys) i can see stars !!
Posted: Sat May 02, 2009 5:09 am
by athanazio
aha !! regular polygon component !
things are getting very nice,

- polygons and stars.png (57.18 KiB) Viewed 4617 times
still have some creppy behaviors on filling but the calculations are working, any suggestions why we have both problems ?
Re: LOVEly Eyes (GUI Toys) update of 2009-04-29
Posted: Sat May 02, 2009 6:25 am
by Robin
OK, still no gradients on ye old 'buntu. Other than that (and the odd color fill bug) it seems fine.
About that last one: I thought SDL could only handle polygons with up to six joints. I believe it's on this forum somewhere.