MV Show tilted images

Many of you have seen the card games I made in the past. There is one thing I never liked here: Every picture is perfectly straight up.

So, there is 2 things I would like to achieve:

I want to show a picture in a certain angle. Lets say 30 degrees. Normally I would use the default script call to show images, but how do I make them tilted?

I would love to be able to turn them from 0 degrees to 30 degrees, or 0 degrees to 330 (a.k.a -30) degrees and back.

Is it possible with RPG maker? Any help is welcome.

(I know about the rotate function in MV, but that doesn't allow me to go for 0 degrees to X degrees and back.)
Use the Show Picture Command and then use a script call below it - change it to the number you want in degrees (not radians - some functions/properties use radians):
s1.png

s2.png
Something like this?
index.php


https://forums.rpgmakerweb.com/inde...e-characters-during-move-routes-mv-mz.149633/
As @bass2yang says, you can use $gameScreen._pictures[1]._angle,

but if, for example, you set $gameScreen._pictures[1]._angle = 90 , it will instantly change the angle to 90°.

If you want a gradual rotation, you can use rotate:

you say :
(I know about the rotate function in MV, but that doesn't allow me to go for 0 degrees to X degrees and back.)

But that's not entirely true:

The rotate speed in the event corresponds to the rotation in degrees per frame. So by initializing a rotate and stopping it at the right moment, you can use it:

For example, if you set a speed of 2 and wait 16 frames = 32 degrees.

If you don't want to use it in an event, you can also use it in a script, exemple :

◆ Loop
◆ Script :
Code:
var pic = $gameScreen.picture(1);
  if (pic._angle < 180) {
      $gameScreen.rotatePicture(1, 5); // vitesse
  } else {
      $gameScreen.rotatePicture(1, 0); // stop
      break;
  }
◆ Wait: 1 frame
◆ Repeat
Wow. I kinda thought the static imaged was one of the limitations of RPG maker... This is helping me move forward so much. $gameScreen._pictures(1)._angle is exactly what I was looking for.

I'm not so sure about the loop though, since I want to use it in a plugin. I mean, I could use it in a loop still... In a for (n = pic._angle ; n < 30 ; n++) or something.

You guys have given me a lot to play with. Thank you very much.
Wow. I kinda thought the static imaged was one of the limitations of RPG maker... This is helping me move forward so much. $gameScreen._pictures(1)._angle is exactly what I was looking for.

I'm not so sure about the loop though, since I want to use it in a plugin. I mean, I could use it in a loop still... In a for (n = pic._angle ; n < 30 ; n++) or something.

You guys have given me a lot to play with. Thank you very much.
When using a plugin, your loop will run the code immediately and return to you the final result instantly. You will need to tie it into the Game_Picture.prototype.update() method which updates the code every frame. This allows you to process it frame by frame rather than all of it together within one frame.

This is why event commands are popular because you can event the code, use wait frames, and update it within the Game_Interpreter (the event commands and script calls that reference "this").

An example to look at is the updateRotation() method (and the other update methods like updateMove() or updateTone()) that can help you establish a baseline for your plugin/script call:
JavaScript:
Game_Picture.prototype.updateRotation = function() {
    if (this._rotationSpeed !== 0) {
        this._angle += this._rotationSpeed / 2;
    }
};
This code is updated every frame in the Game_Picture.prototype.update() method (which is updated by Game_Screen, etc.):
JavaScript:
Game_Picture.prototype.update = function() {
    this.updateMove();
    this.updateTone();
    this.updateRotation();
};
Alias the .update() method and it should process it frame by frame along with everything else.

Edit:
If you are eventing, it would look like this:
1756000356049.png
- Show Picture 1
- Loop 1:
- Wait 1 frame, increase the angle of picture 1 by 1 degree
- Check for when the angle of picture 1 is 30 degrees and if it is, break the loop
- Loop 2:
- Wait 1 frame, decrease the angle of picture by 1 degree
- Check for when the angle of picture 1 is 0 degrees and if it is, break the loop
Okay, that sounds certainly more complicated. 😛
Okay, that sounds certainly more complicated. 😛
In a sense, it may feel that way at first. I didn't even know what alias (or an interpreter) was until just a few years ago and even then, I didn't fully understand it until just this year.

It just takes a bit of getting used to the syntax and the flow of it. I'd be more than happy to share with you my approach for a quick plugin if you would like.

(This is what I usually do when I am working through code in the first few stages. I patch things and see if it needs improvement and if it is something I can really use. If it is, I'll port it to my main .js document and give it a better name space, parameters, etc.).

And, like other things, it is not the only way to do it.
I came across this card plugin that might interest you. It said it worked for MV & MZ. It is a card combat plugin and it has the cards slightly rotated. https://mythatelier.itch.io/card-game-combat
1756148949418.png
I came across this card plugin that might interest you. It said it worked for MV & MZ. It is a card combat plugin and it has the cards slightly rotated. https://mythatelier.itch.io/card-game-combat
View attachment 348293
Thanks. But uhm... A plugin is not the solution for me. I am making a poker plugin. And I don't want my plugins require other plugins. 😛

Original thread: https://forums.rpgmakerweb.com/threads/show-tilted-images.179731/