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

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

Robin wrote:About that last one: I thought SDL could only handle polygons with up to six joints. I believe it's on this forum somewhere.
If I remember correctly it was the physics engine which could only handle 6 points, not SDL. (and I'm pretty sure I do remember correctly :P)
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 »

bartbes wrote:
Robin wrote:About that last one: I thought SDL could only handle polygons with up to six joints. I believe it's on this forum somewhere.
If I remember correctly it was the physics engine which could only handle 6 points, not SDL. (and I'm pretty sure I do remember correctly :P)
In that case, I'm probably mistaken.
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-29

Post by athanazio »

#fill polygon
look at this
http://love2d.org/docs/love_physics.html
* Only convex shapes are supported.
* The max vertex count for on a single polygon is 8.
* There are 16 shape categories.
in the polygon docs dont say anything about limitation
http://love2d.org/docs/love_graphics_polygon_1.html

I believe that I will end up splitting the polygon in triangles, that would be good also to use the
result in a physics simulation...

#gradient
and about the gradient, I will try with thicker lines
2 point lines for example to see if it works

cheers
Nothing is simple but everything is possible.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

This thread is one big conversation between you guys (athanazio and robin), but I wanted to report gradient fill does work on Ubuntu. (so maybe it's Xubuntu related, or it's the driver)
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 »

but does the gradient work on other linuxes ?
just to know If I should try to change the implementation or not
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 »

athanazio wrote:and about the gradient, I will try with thicker lines
2 point lines for example to see if it works
Well, congratulations. I don't know why, but setting LineWidth to 2 fixed the gradient issue on my Xubuntu boot.

While looking at the gradient code, I saw that the horizontal and vertical gradient functions are nearly identical. Wouldn't it be better (i.e.: easier to debug and upgrade) to put it in one function. I uploaded a file to demonstrate it.

EDIT: there was some trouble uploading, but it's up now.
Attachments
gradient.lua
(3.32 KiB) Downloaded 177 times
Help us help you: attach a .love.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LOVEly Eyes (GUI Toys) update of 2009-05-03

Post by appleide »

Hmm... if you could 'cookie cut' images then you could make gradients of a single color just by cookie cutting the image into , e.g star , and layer it over the star. The image is just a semi-transparent gradient from black to white. Using images would save some processor time instead of having to draw a gradient line by line, imo. But it can't do different sets of colors...

I like the multiline edits; they're quite cute. :nyu:
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-05-03

Post by athanazio »

#1 gradient merge of code
Robin wrote:While looking at the gradient code, I saw that the horizontal and vertical gradient functions are nearly identical. Wouldn't it be better (i.e.: easier to debug and upgrade) to put it in one function. I uploaded a file to demonstrate it.
good idea but the code got a little complex for my little brain ... and broke some gradients hehehe, so we will keep the linewith=2 and keep separate for now

#2 gradient fill for the stars
also fixed the way the gradient were working for the stars, internally a matrix o points is created, so the gradient knows where each line starts and ends, but in the case of the stars ... we have some little problems like the following example

100000001000001000001

that could be understood as 2 blocks on the left and right ... or a tiny point on the left a block in the middle anda point at the right, as we had only zeros and 1 there were no identification of the outside of the polygon, so I add the "2" to the matrix that is the outside of the polygon by making fill with 2 until find "1" from the 4 directions of the bounding box of the polygon. doing like this the sample become this

122222221000001222221

and indicates the external and internal points.

#solid color fill of stars
oh well the stars were just with some sort of headache, so I just split in smaller chunks to make the filled polygon drawer life easier hehehe, cut the triangles, and the inner polygon, worked very fine !!

here is the current version and a screenshot
localyeyes_20090503.love
(27.1 KiB) Downloaded 184 times
lovelyeyes stars gradient.png
lovelyeyes stars gradient.png (51.4 KiB) Viewed 3600 times
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-05-03

Post by athanazio »

appleide wrote:Hmm... if you could 'cookie cut' images then you could make gradients of a single color just by cookie cutting the image into , e.g star , and layer it over the star. The image is just a semi-transparent gradient from black to white. Using images would save some processor time instead of having to draw a gradient line by line, imo. But it can't do different sets of colors...
excellent idea ! I will think some sort of caching to avoid the calculation each time of the lines
would be great to have a way to build the images in memory and just use it,
instead of loading from the file everytime
appleide wrote:I like the multiline edits; they're quite cute. :nyu:
after I make the text ballon component
I believe will be the time to add the scroll bar to the multiline edit hehehehe

cheers
Nothing is simple but everything is possible.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LOVEly Eyes (GUI Toys) update of 2009-05-03

Post by appleide »

... this is awesome!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests