Move picture by percentage/ certain number of pixels

Symbol_

Veteran
Veteran
Joined
Nov 28, 2017
Messages
116
Reaction score
18
First Language
English
Primarily Uses
RMMV
I need a move picture command that moves a certain percentage each time you call it rather than specific coordinates.

I don't mind if its script instead of a plugin
 

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,451
First Language
English
Primarily Uses
N/A
Oh man, pictures are annoying to call in script.
I have a plugin that is NOT yet available for release (and my never be) that does this and a bunch of other stuff with pictures.
Here's the call to show a picture, with the arguments named
$gameScreen.showPicture(picturedId, name, origin, x, y, scaleX, scaleY, opacity, blendMode)

Here's the call to move a picture, with the arguments named
$gameScreen.movePIcture(pictureId, origin, x, y, scaleX, scaleY, opacity, blendMode, duration)

If you want to use percentages, then you should have variables, set aside for an x and a y coordinate.
Each time you show or move the picture, replace the coordinates with the variables that hold x and y.

You can easily increment the variables by percentage, a number of ways.
The thing is, calling game variables in code is long, too.
Here's what a completed call may look like:

$gameScreen.showPicture("Sword", 0, $gameVariables.value(1), $gameVariables.value(2), 100, 100, 255, 0)

It's a pain to type, and the more you type the more you risk mistakes, and then headaches.

But there, the best way to honestly do it is to have a place to keep track of the x and y, and use those as the arguments when you show or move the picture.
This will allow you to do any kind of math you want very easily, including working with percentages without inline math
 

Symbol_

Veteran
Veteran
Joined
Nov 28, 2017
Messages
116
Reaction score
18
First Language
English
Primarily Uses
RMMV
This might work. But given the ballache I might just forgo a more efficient method in favour of something similar. I.e using variables to call screen x and y and subtracting and adding onto those variables as and when it needs to. I suppose the only upside with a percentage method is better clarity
 

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,451
First Language
English
Primarily Uses
N/A
As long as it works ^^ But you know you could the percentages easily from the event menu.
Select the variable, choose Mul (for multiply, of course)
and then instead of a hardcoded value, you click the script box and write, for example
1.25

And that would multiply the variable's percentage by 25%

I only say so since it sounds like you'll be using the event editor for variables
 

Symbol_

Veteran
Veteran
Joined
Nov 28, 2017
Messages
116
Reaction score
18
First Language
English
Primarily Uses
RMMV
As long as it works ^^ But you know you could the percentages easily from the event menu.
Select the variable, choose Mul (for multiply, of course)
and then instead of a hardcoded value, you click the script box and write, for example
1.25

And that would multiply the variable's percentage by 25%

I only say so since it sounds like you'll be using the event editor for variables
Oh wow this made me feel dumb! Thank you!
 

standardplayer

Keeper of Kitties
Veteran
Joined
Apr 6, 2016
Messages
698
Reaction score
3,451
First Language
English
Primarily Uses
N/A
No worries lol don't feel dumb, I once spent a half hour hunting through event codes to figure out why whenever I moved my character's starting location, he would start as Transparent. Which is what happens when you enable 'Start Transparent' in the System tab. ><
Glad I could help
 

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,158
First Language
English
Primarily Uses
N/A
You can use my plugin, Move Picture - Extended, to make this a lot easier for yourself, as it allows you to use variables with all the properties of move picture, as well as relative values. It also (optionally) allows you to use animation curves for properties, as it integrates with another plugin of mine.

Hope you find it useful :)
 

Symbol_

Veteran
Veteran
Joined
Nov 28, 2017
Messages
116
Reaction score
18
First Language
English
Primarily Uses
RMMV
I don't know if I have to start a new thread for this but I don't want to spam the forum. But are there any ways or plugins to get animations such as the battle ones to play on top of pictures?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,048
Messages
1,018,545
Members
137,834
Latest member
EverNoir
Top