Page 1 of 1

cool turbine triangle gradient!

PostPosted: Tue Nov 21, 2006 12:54 am
by Game A Gogo
hey yalll!
ive come up whit a cool code that makes a cool gradient!

1. create a canvas actor named me canvas.
2. make it the same size as the view,
3 on create actor, add this code:
Code: Select all
int Count;
for(Count=0; Count<height*4; Count+=4)
{
setpen(Count/4, Count/2, Count/3, 0, 5);
moveto(0, Count/4);
lineto(width, Count);
}

and its done!

change the division where the color inside and it makes other color.

NOTE:
this was tested and aproved on a 640x480 screen resolution, it dosnt give the same result on a smaller screen and there is too much white when bigger.

PostPosted: Wed Nov 22, 2006 3:31 pm
by Zehper48
W0W that looks awesome

PostPosted: Wed Nov 22, 2006 11:24 pm
by Game A Gogo
thx

PostPosted: Sat Nov 25, 2006 12:20 am
by Oman
that is cool 8)

wat if i wanted to make it more like sky,
like more blue and less dark at the top
wat do i need to change to change colors

PostPosted: Tue Nov 28, 2006 12:30 am
by Game A Gogo
well then
it needs another code
like ummm.
THIS ONE:
Code: Select all
int Count;
for(Count=height*4; Count>0; Count-=4)
{
setpen(Count/4, Count/3, Count/2, 0, 5);
moveto(0, Count/4);
lineto(width, Count);
}

not sure if it will work, just maded some quick changes.

PostPosted: Tue Nov 28, 2006 9:21 am
by DilloDude
The big question is: is using code to do a nice background better, or is using an image file (like a printscreen of the code) more efficient. With drawing it, it only has to draw once, and with an image is loads once. Assuming that maintaining the image is the same for an animation as a canvas (which isn't necesarily so) the difference will be mostly in the file size: the draw version needs to store the extra code used to generate the image, whereas the image version needs to store the compressed image file. Which is better?

PostPosted: Tue Nov 28, 2006 1:19 pm
by Oman
That looks awsome :D

Can you give me the code (if you know it)
to turn that image upsidedown. So that the
black would be at the bottom and the white at
the top.That would be even cooler :D :D :D

PostPosted: Wed Nov 29, 2006 12:10 am
by Game A Gogo
DilloDude wrote:The big question is: is using code to do a nice background better, or is using an image file (like a print screen of the code) more efficient. With drawing it, it only has to draw once, and with an image is loads once. Assuming that maintaining the image is the same for an animation as a canvas (which isn't necessarily so) the difference will be mostly in the file size: the draw version needs to store the extra code used to generate the image, whereas the image version needs to store the compressed image file. Which is better?

yes, but whit canvas, you have more flexibility, and i was just tuning up my knowledge for drawing whit canvas.

PostPosted: Wed Nov 29, 2006 8:22 am
by DilloDude
Yes, canvases are good for fiddling around with things. But if images are more efficient, you can still use canvas - just fiddle with them in a separate game file, then run it and use printscreen to get the actual result.

PostPosted: Wed Nov 29, 2006 10:43 pm
by Game A Gogo
sure is true!