Status
Not open for further replies.

Hahasea

Veteran
Veteran
Joined
Jul 4, 2019
Messages
151
Reaction score
17
First Language
English
Primarily Uses
RMMV
I'm not too keen on the right aligned pause indicator that Galv's Message Styles makes all text boxes default to, but I can't quite figure out how to change it back to middle aligned.
upload_2019-8-16_17-0-50.png

I'm pretty sure it's in this bit here in the js:
upload_2019-8-16_17-1-36.png

I already tried altering
this._windowPauseSignSprite.anchor.x = 0;
however while this moves the pause icon, it does so in pixels, so when the boxes are different widths the location is varied. Using a % breaks the code.

It seems I need to change where the anchor is set, back to the default rpgmaker bottom middle of boxes, but I can't figure out how to do that? Any idea?
 
Last edited:

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,646
First Language
Czech
Primarily Uses
RMMV
Programming works the same, regardless if it's rpg maker or an actual programming language.
Using % breaks the code, because % is the operator for modulus. If you want to move a to the middle of b, you want to set its x to the middle of the message window. By default that's done through
a.x = (b.width - a.width) / 2 for center alignment and
a.x = b.width / 2 for left alignment.
 
Last edited:

Hahasea

Veteran
Veteran
Joined
Jul 4, 2019
Messages
151
Reaction score
17
First Language
English
Primarily Uses
RMMV
@Poryg sorry, I was away for a bit. Thanks!

I'm no scripting expert, so can I ask a few questions?
  • I'm not sure what I'd use for 'b.width'
    Some guesses with a bit of context:
    • 'windowwidth'
    upload_2019-9-3_21-35-33.png
    • 'Graphics.boxWidth'
      upload_2019-9-3_21-30-35.png
    • 'Window_Base._faceWidth'
    upload_2019-9-3_21-32-30.png
  • 'a.width' - are we talking the width of the pause icon? Is width measured in pixels?
Thanks for your help :)
 

Attachments

  • upload_2019-9-3_21-9-56.png
    upload_2019-9-3_21-9-56.png
    39.3 KB · Views: 2

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,646
First Language
Czech
Primarily Uses
RMMV
The a and b has nothing to do with programming, it's generalization. Just like in algebra you have a^2 + b^2 = c^2 - Pythagoras's theorem - a generic equation that shows the relation between the three sides of any right angled triangle. What does "a", "b" and "c" mean is, a and b are the two shorter sides, c is the longer one. But the particular names of course depend on how the triangle is named.

Here it is the same case. You want to move one object into the other. Since I don't know how Galv's message styles does it, I substituted the particular variable names for a and b. I only described what's supposed to happen (albeit I had done it wrong in my previous post, so I edited it).
So if the description is
"If you want to move a into the middle of b, you want to set its x to half of b's width"
and you want to move a pause icon to the center of the window, then yes,
a is the pause icon, b is the window.
And yes, if the window's width is set as its window width, then window width is what you're searching for. If it's set to Graphics.boxWidth, Graphics.boxWidth is what you're searching for. It's not as much programming as it is algebra.
 

Hahasea

Veteran
Veteran
Joined
Jul 4, 2019
Messages
151
Reaction score
17
First Language
English
Primarily Uses
RMMV
@Poryg
Ok thanks. Yeah I understand the equation, I just wasn't sure which parts of the script to call on to do it.

I just tried all of those guesses, and none of them work properly, but I'll keep trial and erroring until I find the right one. Cheers.

*Edit*
Haven't had any luck with this. Has anyone succeeded in moving the pause icon, and can tell me how they did it?
 
Last edited:

SeaPhoenix

Veteran
Veteran
Joined
May 14, 2015
Messages
255
Reaction score
235
First Language
English
Primarily Uses
RMMV
You can just change the position in the plugin parameters, there's no need to edit the code. Under "Input Indicator" of the plugin parameters, the first number is the general position in the message box (as the help for that parameter says, it's based on the keypad, so 1 is bottom left, 2 is bottom, 3 is bottom right, etc) and then you enter the x and y coordinates. You can try 2, 0, 0 to start with, and then modify the x and y coordinates to get the indicator exactly where you want. :)
 

Hahasea

Veteran
Veteran
Joined
Jul 4, 2019
Messages
151
Reaction score
17
First Language
English
Primarily Uses
RMMV
You can just change the position in the plugin parameters, there's no need to edit the code. Under "Input Indicator" of the plugin parameters, the first number is the general position in the message box (as the help for that parameter says, it's based on the keypad, so 1 is bottom left, 2 is bottom, 3 is bottom right, etc) and then you enter the x and y coordinates. You can try 2, 0, 0 to start with, and then modify the x and y coordinates to get the indicator exactly where you want. :)

WHAAAAAT????!! How did I miss that?! I can't believe I've been banging my head against a wall for so long when it was right there all along. :blush:

Thank you @Sea Phoenix! That worked!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,147
Reaction score
5,380
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

SF_People1_2 added!
index.php

Ami
--- Minimum Requirement ---

M.Knight: Phew...finally,i got the New Game. Let's check the Requirement
"Minimum Requirement:
  • 2.00 Ghz CPU
  • Full HD Support GPU
  • 5GB Memory"
M.Knight: I just have decent Gaming PC,i can play 2010-2015 Games. Hope it's okay
(1 Hour Later,The Game FPS Just Got 10-20)
M.Knight: (Facepalm)
Next goal is to make pull & push + lift & throw systems with mouse support and have skill levels in them and action indicators!
>What's your avatar about? Is it yours?
I did not do that drawing. It's a screenshot taken from a comic featuring characters from Touhou such as Tenshi and Iku (the girl in the avatar). It's drawn by someone under the name of Yohane.
Link to the comic (SFW, but navigating around Dynasty Reader is NSFW)

Forum statistics

Threads
109,171
Messages
1,042,710
Members
141,668
Latest member
Noel_Lwin
Top