Is there a way to do zoom_x and zoom_y for the sprites and tilingsprites?
zoom_x and zoom_y
Learning JavascriptWith MV you'll want to look into the 'scale' property. Note, however, this time it isn't two separate variables. It's scale.x and scale.y. Other than that, they work pretty much the same way.
However beware because doing
this.spritename.scale.x = -1this.spritename.scale.y = -1will invert the sprite >>
this.spritename.scale.x = -1this.spritename.scale.y = -1will invert the sprite >>
As I recall, that's how they worked in other makers, so that should be fine. Even if it isn't here w they worked, I think that it's better to have an easy way to flip them.
I think the most notable thing in this case, though I'm not sure how it worked in previous versions, is that inverting the scale will place the sprite on the other side of the inverted axis. For example, a scale of x = -1 and y = 1 will draw the sprite such that it's X and Y positions are the top RIGHT corner, not top Left corner. This is an important topic to note.
I also found out that they don't exactly zoom up. Here's what I mean. I have an image that's circular and I want it to become larger by zooming it, but instead, it transformed the image, by transforming, what I mean is, when I placed scale.x and scale.y to 0.40, it did decrease the size of the circle, but starts on the top left.
What measurements should I do it with so it beams up the image starting from the center?
What measurements should I do it with so it beams up the image starting from the center?
@Milena: That'd be the sprite's anchor properties: anchor.x and anchor.y. Centering would be
anchor.x = anchor.y = 0.5Combining both into one line here.
anchor.x = anchor.y = 0.5Combining both into one line here.
I see. Thanks a lot. What I came into solution so that the bigger image would fit is actually to divide the image to your current window sizes, then scaling it. Never knew there was an easier way. I'll remember this method 🙂
Original thread: https://forums.rpgmakerweb.com/threads/zoom_x-and-zoom_y.50929/