Hi, does someone know how to move this input number?
How can i change the input number position?
RPG Maker MZ SupportIt would be easier to zoom the background in exactly to the right scale, so the display would show exactly behind the numbers.
If you did make it yourself or if you can edit, I would suggest a little change: Put the display above the numbers. This would make it look better then zooming. Otherwise if would look as if you bend over (because the zoom moves down).
Strike that. while I write this, I see the display is exactly in the center of the image, which would make the zoom a lot easier.
Now you probably need to know how large those % have to be... I need a calculator for that. 😛 brb.
Edit: Try moving picture to 338% width and 338% height, and 148 pixels to the right.
Edit again: Make sure your background image is set with CENTER as anchor, not TOP LEFT. This counts for both the "Show Image" as the "Move Image" commands.
Strike that. while I write this, I see the display is exactly in the center of the image, which would make the zoom a lot easier.
Now you probably need to know how large those % have to be... I need a calculator for that. 😛 brb.
Edit: Try moving picture to 338% width and 338% height, and 148 pixels to the right.
Edit again: Make sure your background image is set with CENTER as anchor, not TOP LEFT. This counts for both the "Show Image" as the "Move Image" commands.
Try saving this as a .js file, add it to your js/plugins folder and add it in your Plugin Manager. You can change the part at the bottom that says "+ 100" to whatever value you want to add or remove from the y position of the window.
Code:
Window_NumberInput.prototype.updatePlacement = function() {
const messageY = this._messageWindow.y;
const spacing = 8;
this.width = this.windowWidth();
this.height = this.windowHeight();
this.x = (Graphics.boxWidth - this.width) / 2;
if (messageY >= Graphics.boxHeight / 2) {
this.y = messageY - this.height - spacing;
} else {
this.y = messageY + this._messageWindow.height + spacing + 100;
}
};
It works!!! Thank you so much! :awink:
Btw do you know how to resize this windowskin part? it's really annoying lol :asad:
Edit: i found a bug when the message box appears after the input number, apparently the input number resets its position when i attempt to set the code again... any solution?
I think that's the part where the mobile-friendly buttons usually go, but if you're not using them then you can adjust another part of that plugin to cut off the window.
Try changing this line:
this.height = this.windowHeight();
to this:
this.height = this.windowHeight() - 50;
You can adjust the "50" to finetune how you want it to look. 😀
Huh? It is displayed down at the bottom? Oh... I thought you wanted the numbers to show on the display in the background image. 😛 Haha.
Hey man it's me again, i apparently found a bug which the window input number resets his position before or after a message text box appears.
How i can fix it and keep the custom position forever.😅
I don't see anyplace in the code that sets a position for a number input window aside from the function Caz already gave you.
Are you using any plugins?
You may have to copy and paste a script call to that updatePlacement() method each time you have a number input.
Are you using any plugins?
You may have to copy and paste a script call to that updatePlacement() method each time you have a number input.
Doesn't the location always be adapted to the position of the last shown message, like with choices? So when you show a message in the center, the input would be placed on top, and if you show the message on top, it will be placed in the center?
Tested: yes it does.
Message at the bottom
Message in the middle
Message on top
EDIT: It's not a solution, but that is why it resets.
Tested: yes it does.
Message at the bottom
Message in the middle
Message on top
EDIT: It's not a solution, but that is why it resets.
Hi, i'm not using other plugins for the input number, so i need to use the script call UpdatePlacement() to keep it's position.
Before your Input Number command, use a Show Text command exactly like this:
Make sure the background is set to "transparent" and the window position is "top." This'll open a message window and immediately close it again without making it visible to the player, and it'll reset the Number Input position.
Alternatively you could find a fleshed out version of that plugin to better finetune the positioning, but sadly I'm not too well versed in JS so I'm not much more help than that sorry!
Hey man, thanks for replying, don't worry... thanks anyway!
As mentioned, the number input window has 2 cases for its position: above the message (message at bottom of screen) and below the message (top/middle). Caz's override only affects the second case.
Here's an alternative (with a
The button area should be removed automatically if the Touch UI game option is turned off. (If you happen to be using the plugin I suggested in your other thread, then that option should be permanently off.) If that's not working for whatever reason, you could add a simple override to the end of the plugin code:
There's not really anything wrong with what Caz suggested for this, since their solution is a complete override anyway. I just prefer to use the methods provided. 👋
Regardless of whose solution you use, you should never need to manually call the window's
Here's an alternative (with a
@target MZ header to suppress MZ's Plugin Manager warning):
JavaScript:
/*:
* @target MZ
* @url https://forums.rpgmakerweb.com/threads/162040/
* @help Free to use and/or modify for any project, no credit required.
*/
;void (alias => {
Window_NumberInput.prototype.updatePlacement = function() {
// move to original position
alias.apply(this, arguments);
// then move vertically to (50 px from bottom of UI display area)
this.y = Graphics.boxHeight - this.height - 50;
};
})(Window_NumberInput.prototype.updatePlacement);
JavaScript:
Window_NumberInput.prototype.windowHeight = function() {
return this.fittingHeight(1);
};
Regardless of whose solution you use, you should never need to manually call the window's
updatePlacement method in a script call! The engine should do that when Input Number starts, just like it does with Select Item or Show Choices. If it's not doing that, then you have something strange going on in your project. 😴Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-change-the-input-number-position.162040/