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

You must understand the Game Editor concepts, before post here.

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

Postby speckford123 » Sat Oct 06, 2007 4:53 pm

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....
speckford123
 
Posts: 334
Joined: Fri May 05, 2006 6:33 pm
Score: 49 Give a positive score

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

Postby Freddy » Sat Oct 06, 2007 7:36 pm

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
Attachments
Paint Screenie.PNG
heres a picture I made with it!
canvas.zip
A paint-like drawing thing
(3.79 KiB) Downloaded 181 times
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

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

Postby Kalladdolf » Mon Oct 08, 2007 5:11 pm

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 ?
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

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

Postby Freddy » Mon Oct 08, 2007 6:09 pm

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 :) .
Attachments
canvas.zip
Hope you like it!
(777 KiB) Downloaded 176 times
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

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

Postby speckford123 » Wed Oct 10, 2007 7:25 pm

Well I wanted the canvas erased transparent, oh well.
speckford123
 
Posts: 334
Joined: Fri May 05, 2006 6:33 pm
Score: 49 Give a positive score

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

Postby Kalladdolf » Thu Oct 11, 2007 1:50 pm

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) ?
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

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

Postby Freddy » Thu Oct 11, 2007 11:27 pm

What do you mean?
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

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

Postby DilloDude » Fri Oct 12, 2007 12:22 am

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.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

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

Postby Freddy » Fri Oct 12, 2007 12:38 am

Hey Dillodude! Nice to see you back on the forums! :D
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

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

Postby Kalladdolf » Sat Oct 13, 2007 7:06 pm

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
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

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

Postby Freddy » Sat Oct 13, 2007 7:11 pm

Ooooohhh! Thats why it wasnt working! But how would I get the text data? :|
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

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

Postby Kalladdolf » Sat Oct 13, 2007 7:19 pm

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)
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

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

Postby Freddy » Sat Oct 13, 2007 7:48 pm

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
Attachments
canvas.zip
Finally lol :D
(826.36 KiB) Downloaded 182 times
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

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

Postby Freddy » Sun Oct 14, 2007 2:58 pm

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
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

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

Postby speckford123 » Mon Nov 19, 2007 3:12 am

thanks for the help, but without collision stuf like destructable terrain(like worms) is still far away, oh well on to other things
speckford123
 
Posts: 334
Joined: Fri May 05, 2006 6:33 pm
Score: 49 Give a positive score

Next

Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest