drawfrom function[Help]

Non-platform specific questions.

drawfrom function[Help]

Postby ResourceDragon » Mon Apr 02, 2012 8:22 am

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?
Last edited by ResourceDragon on Mon Apr 02, 2012 8:29 pm, edited 1 time in total.
ResourceDragon
 
Posts: 39
Joined: Thu Feb 16, 2012 2:17 am
Score: 0 Give a positive score

Re: drawfrom function

Postby skydereign » Mon Apr 02, 2012 8:31 am

It cannot draw tiled actors.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: drawfrom function

Postby ResourceDragon » Mon Apr 02, 2012 5:09 pm

Perfecto. That's exactly what I wanted to know.
ResourceDragon
 
Posts: 39
Joined: Thu Feb 16, 2012 2:17 am
Score: 0 Give a positive score

Re: drawfrom function

Postby ResourceDragon » Mon Apr 02, 2012 6:55 pm

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.
ResourceDragon
 
Posts: 39
Joined: Thu Feb 16, 2012 2:17 am
Score: 0 Give a positive score

Re: drawfrom function[Help]

Postby skydereign » Tue Apr 03, 2012 12:49 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: drawfrom function[Help]

Postby ResourceDragon » Tue Apr 03, 2012 3:58 am

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 )
ResourceDragon
 
Posts: 39
Joined: Thu Feb 16, 2012 2:17 am
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest