Drawing function help

Non-platform specific questions.

Drawing function help

Postby smillz » Wed Apr 30, 2008 11:35 pm

I'm kinda new to drawing functions, and I thought a canvas actor would add some interesting attributes to my game so I have some questions to what I can and cannot do.

Question 1: How can I make the whole canvas actor to instantly change one color?
Question 2: Can I have the pen to draw from an actor instead of the mouse?
Question 3: Can I make the pen circular instead of square?
Question 4: Can I have an actor collide only with the drawn portion in a canvas actor?
Question 5: Can I use a Draw From function on an area instead of just on an actor?

Thanks :D
smillz
 
Posts: 21
Joined: Fri Jul 20, 2007 2:10 am
Score: 0 Give a positive score

Re: Drawing function help

Postby makslane » Thu May 01, 2008 12:50 am

smillz wrote:Question 1: How can I make the whole canvas actor to instantly change one color?


Use the funcion erase:
http://game-editor.com/docs/script_reference.htm#erase

Question 2: Can I have the pen to draw from an actor instead of the mouse?


Just use the coordinates of the actor, instead the mouse position.

Code: Select all
int xn, yn;

xn = youractor.xscreen;
yn = youractor.yscreen;

screen_to_actor(&xn, &yn);
putpixel(xn, yn);


Question 3: Can I make the pen circular instead of square?


No, sorry

Question 4: Can I have an actor collide only with the drawn portion in a canvas actor?


Sure! But first, make sure erase the canvas with a transparent color, like:

Code: Select all
erase(0, 0, 0, 1);


Look the attached file.

Question 5: Can I use a Draw From function on an area instead of just on an actor?


You can use only in canvas actors.
Attachments
CanvasCollision.zip
(2.87 KiB) Downloaded 85 times
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: Drawing function help

Postby smillz » Thu May 01, 2008 3:22 am

Thanks! I needed it :wink:
smillz
 
Posts: 21
Joined: Fri Jul 20, 2007 2:10 am
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron