LOVEly Eyes (GUI Toys) update of 2009-06-26

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: LOVEly Eyes (GUI Toys) update of 2009-04-28

Post 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...
Help us help you: attach a .love.
User avatar
athanazio
Citizen
Posts: 96
Joined: Fri Apr 10, 2009 3:12 am
Location: Rio de Janeiro - Brazil
Contact:

Re: LOVEly Eyes (GUI Toys) update of 2009-04-28

Post 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
Nothing is simple but everything is possible.
User avatar
athanazio
Citizen
Posts: 96
Joined: Fri Apr 10, 2009 3:12 am
Location: Rio de Janeiro - Brazil
Contact:

Re: LOVEly Eyes (GUI Toys) update of 2009-04-28b

Post 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
lovelyeyes_20090428b.love
(22.89 KiB) Downloaded 162 times
Nothing is simple but everything is possible.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: LOVEly Eyes (GUI Toys) update of 2009-04-28b

Post by Robin »

Exellent :monocle:. However, both dead keys and gradients do not work for me on Xubuntu. I have no idea why.
Help us help you: attach a .love.
User avatar
athanazio
Citizen
Posts: 96
Joined: Fri Apr 10, 2009 3:12 am
Location: Rio de Janeiro - Brazil
Contact:

Re: LOVEly Eyes (GUI Toys) update of 2009-04-28b

Post by athanazio »

hey masters of the universe any idea why the gradient dont work on Xubuntu ?
is a pretty simple code :D

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
Nothing is simple but everything is possible.
User avatar
athanazio
Citizen
Posts: 96
Joined: Fri Apr 10, 2009 3:12 am
Location: Rio de Janeiro - Brazil
Contact:

Re: LOVEly Eyes (GUI Toys) yes we have roundbox

Post by athanazio »

yes we have rounded boxes ...
just the polygon for now, but soon will become a Rectangle feature :)
lovelyeyes_20090429_yeswehaveroundbox.love
(38.67 KiB) Downloaded 168 times
wow this is rounded.jpg
wow this is rounded.jpg (7.34 KiB) Viewed 1962 times
Nothing is simple but everything is possible.
User avatar
farvardin
Party member
Posts: 164
Joined: Sat Jun 28, 2008 6:46 pm

Re: LOVEly Eyes (GUI Toys) update of 2009-04-29

Post by farvardin »

:neko: we have so many usefull GUI now, I have no excuse to make a decent game!
User avatar
athanazio
Citizen
Posts: 96
Joined: Fri Apr 10, 2009 3:12 am
Location: Rio de Janeiro - Brazil
Contact:

Re: LOVEly Eyes (GUI Toys) update of 2009-04-29

Post by athanazio »

farvardin wrote::neko: we have so many usefull GUI now, I have no excuse to make a decent game!
:P
Nothing is simple but everything is possible.
User avatar
athanazio
Citizen
Posts: 96
Joined: Fri Apr 10, 2009 3:12 am
Location: Rio de Janeiro - Brazil
Contact:

Re: LOVEly Eyes (GUI Toys) i can see stars !!

Post by athanazio »

aha !! regular polygon component !

things are getting very nice,
polygons and stars.png
polygons and stars.png (57.18 KiB) Viewed 1940 times
still have some creppy behaviors on filling but the calculations are working, any suggestions why we have both problems ?
localyeyes_20090502.love
(26.43 KiB) Downloaded 158 times
Nothing is simple but everything is possible.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: LOVEly Eyes (GUI Toys) update of 2009-04-29

Post 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.
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests