Page 1 of 1

drawfrom function[Help]

PostPosted: Mon Apr 02, 2012 8:22 am
by ResourceDragon
I've played around with it, and it seems it can't draw actors that have been tiled? Or is there some special way of drawing a tiled actor?

Re: drawfrom function

PostPosted: Mon Apr 02, 2012 8:31 am
by skydereign
It cannot draw tiled actors.

Re: drawfrom function

PostPosted: Mon Apr 02, 2012 5:09 pm
by ResourceDragon
Perfecto. That's exactly what I wanted to know.

Re: drawfrom function

PostPosted: Mon Apr 02, 2012 6:55 pm
by ResourceDragon
Sorry, but another dumb question. Is there a way to set a canvas actor to draw everything in a specified region?

I've tried to draw them all seperately,(With drawfrom) but getting them all to line up correctly is a pain in the arse. XD

EDIT: Gah, sorry about all the questions. XD

So, i've made it so my player moves toward another actor using the direction function,

Code: Select all
angle = direction( x, y, Sight1.x, Sight1.y);
directional_velocity = 2;


How would I find the perpendicular of this directional line to move left and right? I've tried to use the formula, but i'm having trouble implementing it.

Re: drawfrom function[Help]

PostPosted: Tue Apr 03, 2012 12:49 am
by skydereign
ResourceDragon wrote:Sorry, but another dumb question. Is there a way to set a canvas actor to draw everything in a specified region?

I've tried to draw them all seperately,(With drawfrom) but getting them all to line up correctly is a pain in the arse. XD

You can use variables. Since you can only draw normal actors, their xy coordinates are defined by their center. And you can find their bounding box by subtracting/adding half their width/height. And just use that and it should align easily enough.

ResourceDragon wrote:How would I find the perpendicular of this directional line to move left and right? I've tried to use the formula, but i'm having trouble implementing it.

For this you can just add 90 to the angle they are moving in. So you have the angle variable, so the perpendicular is +90 of that. And you don't need to worry about going over 360, but if you do want to you can use the modulo operator to keep it within the 0-360 range.

Re: drawfrom function[Help]

PostPosted: Tue Apr 03, 2012 3:58 am
by ResourceDragon
1A. I see. I'll try that.

2A. OMG. I never would have thought of that, yet it's so obvious. Thanks! (I should just open a RD's question thread at some point. XD )