Scale Behavior

New releases and general discussions.

Post » Wed Feb 17, 2010 3:17 pm

Hello, everybody, and above all talented plugin devs :)

Having worked with Construct for a little while the need for one behavior pops up most often and that is Scaling. Sure, it can be done with timers and events by doing some math, etc.
But what would be AWESOME would be a decent Scale behavior. Something that lets easily scale a given object both statically and over time. I took the liberty of thinking up some functions it might have. To help illustrate here is our friend the gray rectangle:



And now for all the functions:

PROPORTIONAL SCALING

Scales the object proportionally.
Would be great: Resize proportionally by width, Resize proportionally by height.

SCALE WIDTH

Scales only width.

SCALE HEIGHT

Scales only height.

PROPORTIONAL SCALING OVER TIME

Set the time in ms and amount to scale the object proportionally.

SCALE WIDTH OVER TIME and SCALE HEIGHT OVER TIME



Also awesome would be a feature to set the size by both pixels (for a straight up fixed size) and percent (to scale object to a given percentage of itself).

If anyone would manage to build a behavior which does all this that would be simply amazing (a guaranteed place in the pantheon of godlike plugin coders for sure). Would try to do it myself, but C++ just isnt a programming language I can digest.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Wed Feb 17, 2010 7:56 pm

[quote="Somebody":2a6uadbw]And now for all the functions:

PROPORTIONAL SCALING

Scales the object proportionally.
Would be great: Resize proportionally by width, Resize proportionally by height.

SCALE WIDTH

Scales only width.

SCALE HEIGHT

Scales only height.[/quote:2a6uadbw]

How is this any different from the "Set width" and "Set height" actions?

And I'm not entirely sure that there would be a need for a plugin to change the scale over time, as that's easy enough to do with events. Here's just one method (I can think of several):

http://dl.dropbox.com/u/529356/scale.cap

I don't mean to disparage your idea, I'm just wondering what would make this plugin worth the trouble of creating when it's already got built-in actions for one half and there are really easy methods to do the other half with events. And yeah, I know there are Rotate and Fade behaviors that do simple tasks for you as well, but I doubt their necessity too :P
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Feb 17, 2010 8:25 pm

[quote="deadeye":2zpgtw5c]How is this any different from the "Set width" and "Set height" actions?[/quote:2zpgtw5c]

It's lazy people friendly and lets you enter a single value instead of doing something like this.height = this.height * percentage/100 or so.

And those commands don't do it proportionally, do they?

[quote="deadeye":2zpgtw5c]I'm just wondering what would make this plugin worth the trouble of creating[/quote:2zpgtw5c]

Well, yeah, it's mostly a convenience thing and I must agree development would probably take more time and nerves than most users using it instead of events save. I'd still love an easily animatable Scale behavior. Using extra variables in objects always seems so... "dirty" :)
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Wed Feb 17, 2010 9:20 pm

I could probably pull something like this together in around a day, so I'll probably take a crack at it. Not immediately, though, as I've got more important plugin related things I need to finish up at the moment.
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Wed Feb 17, 2010 10:02 pm

Well you mentioned changing the sine behavior to have a z axis setting, why not add a deactivate for a percentage of the sine? :P
You would probably need to add something where it would ask to continue the sine, or restart it on activation.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Wed Feb 17, 2010 10:56 pm

[quote="linkman2004":36vuhjpn]I could probably pull something like this together in around a day, so I'll probably take a crack at it.[/quote:36vuhjpn]
If you manage to make animatable proportional scaling... you'd probably get a big golden shrine in my little shmup (along with deadeye who'd probably be represented as an acquirable ally WWII fighter pilot who disappeared over the Bermuda triangle, is VERY good at shooting, hence the name and now flies his fighter plane ... IN SPACE ... we far enough off topic yet? :lol:)

Seriously, though, would be great if you could do it some day.

[quote="linkman2004":36vuhjpn]Not immediately, though, as I've got more important plugin related things I need to finish up at the moment.[/quote:36vuhjpn]
Yeah, the sprite button project looks pretty good. Actually all the previous ones are great as well - using Orbiter in a project as we speak. Keep up the great work :)
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Thu Feb 18, 2010 2:46 am

check out the lerp and cosp system expressions for scaling over time

, and for "scale" scaling do some cross multiplication, and you can figure out the scale height or width based upon a chosen/known width or height. or you can multiply them both by a known scale factor.
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Thu Feb 18, 2010 9:14 am

I support this. Would be cool to have a scale behavior!
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Thu Feb 18, 2010 1:25 pm

Yes, it's very easy to do with events and a bit of math, but everything that Construct does can be put in that category.

Why wouldn't anyone want a quick way of doing this without events.
If you need to do something that the plugin doesn't do, then it's time to do the maths.

I also support this plugin.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sat Feb 20, 2010 12:06 pm

Because of all this talk about how easy it is to get the same effect using lerp, timedelta, etc. I decided to give it a try. And while it's certainly possible it's at the same time sort-of cumbersome and would REALLY benefit from a nice and easy behavior plugin :wink:

Still, the result is interesting, check it out here, if you please: [url:2q6i40kh]http://dl.dropbox.com/u/1328856/DT.zip[/url:2q6i40kh]

It's an exe, since it uses the latest unstable build and an extra effect. The Escape key will eject you and the R key will do something as well.

Might just turn it into a full little game, above all if this behavior becomes available, heh, heh.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests