Set height/width as a scale% value instead of pxl?

Get help using Construct 2

Post » Tue Jun 26, 2012 5:16 pm

I am trying to set up my platformer character to crouch ("When Down arrow is down, Set height to X" on the Player object). But it seems to want a pixel value when what be more flexible is a % value, the way scale works.

I did a search and found references to OriginalHeight parameters in Construct Classic but I didn't have any success using them in Construct 2, though it's possible I didn't get the syntax right.

Is there a way set height and wight by percentage and if so, how do I do it? And if it is an unlisted parameter (like OriginalHeight) is there a comprehensive list of these commands somewhere?

Thanks.
B
5
Posts: 20
Reputation: 1,015

Post » Tue Jun 26, 2012 5:28 pm

player.ImageHeight and player.ImageWidth (assuming the player size = the image size)

The expressions are all in the manual:

Sprite expressions:
http://www.scirra.com/manual/115/sprite/page-1

Common expressions:
http://www.scirra.com/manual/133/common-expressionsramones2012-06-26 17:30:44
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Wed Jun 27, 2012 6:05 am

That did the trick! And thanks for the links. I forgot that the Player object was also a sprite so I wasn't thinking of the Image related commands.

B
5
Posts: 20
Reputation: 1,015


Return to How do I....?

Who is online

Users browsing this forum: Mohicano and 31 guests