changing the size from bottom...

S888RAMS888RAM LondonMember, PRO Posts: 41

Hey all,
I wanted to scale the actor using change size. First of all I ahve realized I need to do width and height separately. Can I do them in one action?

Also the actor tend to expand from the center point but I am trying to get it to expand from the bottom. Is there any way around it?

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2014

    @S888RAM said:
    Also the actor tend to expand from the center point but I am trying to get it to expand from the bottom. Is there any way around it?

    Interpolate the actor's size and position so that it changes from its starting size/position to your target size/position.

  • S888RAMS888RAM LondonMember, PRO Posts: 41

    Thanks. Also is it possible to change the width and height in one go?

  • SocksSocks London, UK.Member Posts: 12,822

    @S888RAM said:
    Thanks. Also is it possible to change the width and height in one go?

    You can use the change size behaviour for that.

  • ArmellineArmelline Member, PRO Posts: 5,369

    @Socks said:
    You can use the change size behaviour for that.

    I have never once used the change size behaviour in a real project. I really, really should. I honestly don't remember now why I avoided it, and then it became habit. The silly things we do.

  • S888RAMS888RAM LondonMember, PRO Posts: 41

    @socks Yes but when I choose self.size it has x and y!

    well basically I am trying to make a balloon that expands with each press. But I dont want the position of whole of the balloon to change. I want it to expand from that point rather than the balloon to expand from the center if it makes sense...

  • SocksSocks London, UK.Member Posts: 12,822

    @Armelline said:
    I have never once used the change size behaviour in a real project. I really, really should. I honestly don't remember now why I avoided it, and then it became habit. The silly things we do.

    The same here, I never use it, I don't like the lack of controls, just having a value slider feels clumsy and imprecise (even if it's not), you can of course wrap it in rules to make it arrive at certain values and so on, but I still prefer the control Interpolate gives you.

  • ArmellineArmelline Member, PRO Posts: 5,369

    @Socks said:
    The same here, I never use it, I don't like the lack of controls, just having a value slider feels clumsy and imprecise (even if it's not), you can of course wrap it in rules to make it arrive at certain values and so on, but I still prefer the control Interpolate gives you.

    I have a deep mistrust of interpolate, too. I might do some experiments and see which is more precise and reliable.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    @S888RAM‌ -- To grow from the bottom of the actor you would need to do something like the following:

    1) In the actor , make a self attribute (type = real) called "bottomY"

    2 When time to expand the actor use the following actions/behaviors:

    Change Attribute: self.bottomY To: self.Position.Y-(self.Size.Height/2)
    Timer (for) 1 second
        Change Size -- Growth Rate: 1
        Constrain Attribute: self.Position.Y To: self.bottomY+(self.Size.Height/2)
    
  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2014

    @S888RAM said:
    socks Yes but when I choose self.size it has x and y!

    I'm not sure I understand, you asked if you could change both dimensions in 'one go' ? You can do that with change size, change size doesn't give you individual access to X and Y sizes.

    @S888RAM said:
    well basically I am trying to make a balloon that expands with each press. But I dont want the position of whole of the balloon to change. I want it to expand from that point rather than the balloon to expand from the center if it makes sense...

    Then you must move the position of the balloon ! :smile:

    An object that increases in size while its base remains in one position means that its centre point is moving, GameSalad locates an object by the objects centre, so you will need to move the object to have it grow from a point other than its centre.

    Example: https://www.mediafire.com/?lbw0sl1tpapbjzc

  • S888RAMS888RAM LondonMember, PRO Posts: 41

    You guys rock! yeah totally forgot about change size and I was trying to do it through the attribiutes.

    @Socks thats exactly what I wanted. I guess I have not yet understood the main funcionality of the constrain. Could you explain it a bit..

    Many thanks

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2014

    @S888RAM said:
    You guys rock! yeah totally forgot about change size and I was trying to do it through the attributes.

    Ok, now I am really confused ! :smile: You wrote in your OP: "I wanted to scale the actor using change size" . . . . ?

    @S888RAM said:
    Socks thats exactly what I wanted. I guess I have not yet understood the main funcionality of the constrain. Could you explain it a bit..

    Not sure what to say about it other than it constrains things to whatever value you place in the 'To' field.

    So for instance you could constrain the colour of an actor to its rotation, so when you rotate the actor it becomes more yellow (or whatever) . . . or constrain the volume of your music to the horizontal position of an actor, so as you move the actor left and right the volume goes up and down (Hey presto ! A volume slider !! :wink: ) . . . . or constrain the size of an actor to its vertical position, so it shrinks as it falls (or rises) . . . and so on.

    For example, you could constrain the opacity of your balloon image to its size, so as it grows it becomes more transparent, like a real balloon becomes a little more transparent (see through) when it stretches to its limits.

  • S888RAMS888RAM LondonMember, PRO Posts: 41

    @socks hahaha yeah that was just a coincidence!

    And reagarding the constrains must say it was the best explaination ever! you rock * (1/0) :wink:

  • SocksSocks London, UK.Member Posts: 12,822

    @S888RAM said:
    socks hahaha yeah that was just a coincidence!

    Lol, I though I was going mad :p

Sign In or Register to comment.