how do I change the angle of an object taken as a parameter?

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Tue May 19, 2009 4:40 pm

I want to know how to change things about an object taken as a parameter

a simple example would be if I made Angle Changer object

AngleChanger has an action
Change Angle

it gives a drop down list, where you can choose a sprite

and when that action triggers at runtime it changes the angle of the sprite

obviously useless, and more of a behavior
but, for learning sake
what would the C++ line of code be that changed the parameter object to a new angle
and could I use the same method to change a variable in an object I made with the sdk?

thanks
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Tue May 19, 2009 4:44 pm

Once you've retrieved a CRunObject* from the parameter (see the object parameter retrieving functions in ExpReturn), you'd just do:

object->info.angle = some_angle_in_degrees;
object->UpdateBoundingBox();
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue May 19, 2009 5:06 pm

thanks ashley
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests