Resizing/Scaling Frustrations

0 favourites
  • 6 posts
  • Bit of a rant, but I'd be interested if anyone else agrees with me on this.

    I'm nearly done with my game, and I'm currently going over all of the graphics. Say for example I have a button sprite that's 200x200. I then scale it down to 100x100 in the level editor.

    I then add in a line of code to say if the cursor is over the sprite, increase its scale to 1.1. Now, to me, this would suggest it would increase the size to 110x110, but instead, it ignores the current size, and increases it to its original sprite size + 10%, so I end up with a sprite that's 100x100 when standard, but suddenly 220x220 pixels when the cursor is over.

    To sort this out, I decide that I'm happy with the size 100x100, and change the size of the actual sprite to 100x100. I go back to the editor, and find that my object has noted that I just halved the size, and so it does the same, now measuring 50x50.

    Having to go through my levels and fix this is really frustrating. I'll know in the future how to avoid this (by having an object dump layout) but I can't see how this is useful as a design choice.

    I think the scale function should work on the size of the current object, not the sprite size. In its current state, this makes the scale function useless for me if I intend on working with slightly larger sprites.

    Grr link

  • I use set size to width: self.width*1.1, height: self.height*1.1 for stuff like that. Never had a problem with it so far. And in this case setting scale to a constant size is useful if you want to reset something to its original size after it has been through a number of alterations I guess.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Tobye Have you tried out what you just stated?

    If I have something that says if cursor is over object, set size to self.height*1.1 and self.width*1.1 I have an ever growing object.

    What about the other issue I mentioned? Do you know a way around that?

    Regarding your second point, I do see the benefits to that, but I feel it would be more beneficial to be able to use scale anytime I want, rather than only to revert an object to an original size. I can just as easily use the size function to get back to an original size.

    As it currently stands, I don't see a use for scale if I have a slightly oversized (or undersized) object.

  • I disagree - if you set the scale to 0.55 instead of 1.1 you would have gotten the effect you want. You also could have done set size and multiplied the width and height by 1.1 and used a trigger once. Having no set base value for what 1 means in the scale action would be more confusing, I think.

  • Yeah of course, as indicated by 'I use...' ;) You use trigger once, on collision or something like that. That depends on all your other conditions and what you want to do with it. For the second problem I have no idea sorry! I find it pretty annoying myself.

    If you use set size to go back to the original then yeah you could just set size to image height/width, but scale is slightly easier. And scale would be slightly easier than my method if it worked that way. I'm not saying scale is incredibly useful, but it does have a use and my method of scaling is super easy anyway.

  • Tobye - Sorry, I didn't realise you were referring to the trigger once event as well.

    Arima

    In my project, I'm trying to keep to as few events as possible. I have all of the buttons in a family. Many of them are different sizes, but I want them to all have one thing in common. When the mouse is over them, they pop up from their current scale to 110%. For this reason, I can't use scaled 0.55, as that would affect all objects, including those that are already the correct sprite size.

    I suppose now I can use the trigger once with *1.1 and /1.1, and that gives me the effect I want, but I can't see the point of having scale at all for my project.

    The only time I've ever needed to use scale is regarding buttons so far, but I'll switch that over to size.

    Still struggling to think of a single time I would ever need to use scale over size. Using scale, you'd rarely ever want to go over 1, as you would start to see pixels.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)