Page 5 of 6

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

Posted: Sat May 02, 2009 8:21 am
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)

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

Posted: Sat May 02, 2009 9:25 am
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.

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

Posted: Sat May 02, 2009 2:42 pm
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

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

Posted: Sat May 02, 2009 2:51 pm
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)

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

Posted: Sat May 02, 2009 3:00 pm
by athanazio
but does the gradient work on other linuxes ?
just to know If I should try to change the implementation or not

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

Posted: Sat May 02, 2009 3:16 pm
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.

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

Posted: Sun May 03, 2009 5:31 am
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:

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

Posted: Sun May 03, 2009 5:38 am
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 3598 times

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

Posted: Sun May 03, 2009 5:43 am
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

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

Posted: Sun May 03, 2009 5:45 am
by appleide
... this is awesome!