Page 1 of 1

How would you gradientize a canvas with curved eges?

PostPosted: Sun Sep 06, 2009 2:19 pm
by Hblade
Ok, I have the curved edges part, now I need it to fill up the inside of it with a gradient, but it works with ANY size, say I have one menu 160x340, and another one 150x400, I need them BOTH to be gradientized... o.o I just need a code that fills it up with a gradient. BUT! I cant use erase to fill it with color because it fills it past the curved edges

Re: How would you gradientize a canvas with curved eges?

PostPosted: Sun Sep 06, 2009 6:39 pm
by pyrometal
Use moveto() and lineto(), I've done something like this before here:
http://game-editor.com/forum/viewtopic.php?f=4&t=6243&hilit=+dialogue

Re: How would you gradientize a canvas with curved eges?

PostPosted: Sun Sep 06, 2009 10:11 pm
by Hblade
Thanks, but would you mind explaining these methods?

Re: How would you gradientize a canvas with curved eges?

PostPosted: Mon Sep 07, 2009 12:26 am
by cforall
To pyrometal
:D man your Dialogue engine really blow my mind, I can see you embedded it in your GameOver Land! such good effect!

To Hblade
:D Of course pyrometal did a good job, its pure code but still pixel-level job , if what you want is a BIG rounded rectangle that will be tough... in my opinion 160x340 is big :mrgreen: :mrgreen:
How about making some gradient images and then use draw_from to draw them on canvas by right scale...

Its just lazy man's lazy idea... :mrgreen: :mrgreen: :mrgreen: :mrgreen:

Re: How would you gradientize a canvas with curved eges?

PostPosted: Mon Sep 07, 2009 2:39 am
by Hblade
Hehe, well you see, using scale only scales BOTH width and height, you cant, say "Stretch to size" it.

Re: How would you gradientize a canvas with curved eges?

PostPosted: Mon Sep 07, 2009 2:51 pm
by Hblade
I found a way, and It's called CTW