Page 1 of 2

Advanced draw help...(for collision etc.)

PostPosted: Sat Oct 06, 2007 4:53 pm
by speckford123
Can you collide with things drawn into a canvas?
if so, how?
Also how can I erase parts without erasing the whole?

I never use the draw functions so I have no idea....

Re: Advanced draw help...(for collision etc.)

PostPosted: Sat Oct 06, 2007 7:36 pm
by Freddy
A way you can erase part of the canvas, is, lets say you press E for erase. In the keydown event press e, go to the script editor and type in:
Code: Select all
setpen(255,255,255,0,3);
draw = 0;

This way when you press E, the color of the pen will be white (which basically is what erase is)
To change it back, lets say again that you press R for red or something, go to the keydown event and press r, then go to script editor and type in:
Code: Select all
setpen(255,0,0,0,3);
draw = 0;

This way, the color of the pen is set back to red. If you want, you can adjust the 3 in setpen(255,0,0,0,3);
draw = 0;
to change the line thickness. Hope this helps. Btw, I dont think that you can make a collision with the canvas drawing, but then again, Im not sure. :D
I also atatched a demo if you need it. :D

Re: Advanced draw help...(for collision etc.)

PostPosted: Mon Oct 08, 2007 5:11 pm
by Kalladdolf
um, there's only a ge file without data and everythin'... :(
'course this can't work...
error, can't load this'n'that...


cud u please fix'at ?

Re: Advanced draw help...(for collision etc.)

PostPosted: Mon Oct 08, 2007 6:09 pm
by Freddy
Ugh. Thats annoying, I thought that there wasnt any data. Anyway, here is an exe. version. :D It wont help much :( , but it will substitute until I can figure it out :) .

Re: Advanced draw help...(for collision etc.)

PostPosted: Wed Oct 10, 2007 7:25 pm
by speckford123
Well I wanted the canvas erased transparent, oh well.

Re: Advanced draw help...(for collision etc.)

PostPosted: Thu Oct 11, 2007 1:50 pm
by Kalladdolf
another question, how do u erase parts of a normal actor (like in Worms, when a grenade explodes, it erases a part of the ground) ?

Re: Advanced draw help...(for collision etc.)

PostPosted: Thu Oct 11, 2007 11:27 pm
by Freddy
What do you mean?

Re: Advanced draw help...(for collision etc.)

PostPosted: Fri Oct 12, 2007 12:22 am
by DilloDude
You cannot just erase part of a normal actor, unless you already have animations set up to do it. However, if you draw it on a canvas(such as using draw_from or loading it yourself) you can erase parts of it. It gets a little tricky if you want to cut fancy shapes, but it works.

Re: Advanced draw help...(for collision etc.)

PostPosted: Fri Oct 12, 2007 12:38 am
by Freddy
Hey Dillodude! Nice to see you back on the forums! :D

Re: Advanced draw help...(for collision etc.)

PostPosted: Sat Oct 13, 2007 7:06 pm
by Kalladdolf
Freddy, I know what's wrong with your GE file!
you used text, right?
FONTS ALSO BELONG TO THE GAME DATA! :roll: :roll: :roll:
:D :D :D

Re: Advanced draw help...(for collision etc.)

PostPosted: Sat Oct 13, 2007 7:11 pm
by Freddy
Ooooohhh! Thats why it wasnt working! But how would I get the text data? :|

Re: Advanced draw help...(for collision etc.)

PostPosted: Sat Oct 13, 2007 7:19 pm
by Kalladdolf
nothing :D
just upload your ged file and the data folder.
(if you create a ged file and save it, GE creates a data folder automatically in the same folder as the ged file)

Re: Advanced draw help...(for collision etc.)

PostPosted: Sat Oct 13, 2007 7:48 pm
by Freddy
Yay! I figured it out! Ok, here it is. :D EDIT: I downloaded it, and I found that the .exe version is in there to, but once you open the data folder, you can go to the .ged :D

Re: Advanced draw help...(for collision etc.)

PostPosted: Sun Oct 14, 2007 2:58 pm
by Freddy
Oh no! I was wrong about the erase technique. There is a way that the erase can be transparent, when you choose the setpen action, there is a place for transparency, set it to 1. You can set the color to whatever you want, it doesnt matter what the color is (because it is transparent). :D

Re: Advanced draw help...(for collision etc.)

PostPosted: Mon Nov 19, 2007 3:12 am
by speckford123
thanks for the help, but without collision stuf like destructable terrain(like worms) is still far away, oh well on to other things