ATS Formatting ScrollText Bug (RMVXA)


I want to align the scrolltext window text!
For some reason writing \a[0/1/2] or \a[L/C/R] ALIGN[0/1/2] only applies it after the 1st line??

1607916870094.png
1607916850342.png

Adding or removing a space in between the control chara and text does nothing.
according to the script description, alignment is supposed to work for "this line" only, which means that your example is completely wrong.

what is the default set? that means how will the text look if you use no alignment command?

Because first guess is that the default is already centered, and using the center command again negates it for that line only...
If I am understanding you right... no the alignment should affect the whole text.
It can also be used for game messages, but this error appears only with the scroll text.

The default alignment is 0, but even if I set the default to 1, this error appears........ :dizzy:
no the alignment should affect the whole text.
that is not what the description of the textcode says. I followed the link you gave and the description reads:
# \a[L] - Aligns the text to the left for this line. Can also use \a[0].
# \a[C] - Aligns the text to the centre for this line. Can also use \a[1].
# \a[R] - Aligns the text to the right for this line. Can also use \a[2].

see that "for this line"? That is the basis of my guess
see that "for this line"? That is the basis of my guess
You would be right in that, that's what the script says, but it actually works for the entire message.
Putting \a[C] makes the entire message centered.
I use the script and have my default set to center for the entire game. and it works.
then I have to use \a[L] to make it adjust left.

Zerscares - you can probably try moving the script up or down in your listing as there may be some odd conflict.
I do not have the issue you are describing.
Also for this message you could maybe just put a blank line at the top?
You would be right in that, that's what the script says, but it actually works for the entire message.
Putting \a[C] makes the entire message centered.
I use the script and have my default set to center for the entire game. and it works.
then I have to use \a[L] to make it adjust left.

Zerscares - you can probably try moving the script up or down in your listing as there may be some odd conflict.
I do not have the issue you are describing.
Also for this message you could maybe just put a blank line at the top?
No thanks for the blank line! It looks really ugly hahahaha
I don't understand why it's not giving you the error, I tested it on a new game and it's the only script!

here is my demo.
No thanks for the blank line!
So you gave me a demo and I made a small change and it worked.
I added a blank line.

It also works as expected for all normal messages.
This is only a problem for scrolling text

Why does it look really ugly? Look perfectly normal to me.
1607984850708.png


If you want a scripted solution.. here
Ruby:
class Window_ScrollText
  def start_message
    @text = $game_message.all_text
    @text = "\n" + @text
    refresh
    show
  end
end
A blank line is not a solution, it's a workaround. :dizzy:
I really don't want a blank line for various reasons. Is there really no way to fix this?

EDIT: Also using
Code:
ats_all(:ats_alignment, 0/1/2)
or
Code:
ats_next(:ats_alignment, 0/1/2)
does the same problem...
It can also be used for game messages, but this error appears only with the scroll text.
That is because the window class for the message box (Window_Message) starts off with a method that sets a "new page", and the initial alignment setup for the very 1st line happens there.

But the window class for scrolling messages (Window_ScrollText) got no such thing, hence the 1st line won't get adjusted by alignment message codes.

A fix:
Spoiler
Code:
class Window_ScrollText < Window_Base

  def draw_text_ex(x, y, text)
    reset_font_settings
    text = convert_escape_characters(text)
    pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
    # Addition starts here!
    next_line = text[/^[^\n\f]*/]
    align = maatsf_line_alignment(next_line)
    if align != 0 # If not left aligned
      @atsf_testing = true
      tw = mapf_calc_line_width(next_line)
      @atsf_testing = false
      space = maatsf_total_line_width(pos[:y]) - tw
      pos[:x] = [pos[:x] + (space / (align == 1 ? 2 : 1)), pos[:x]].max
    end
    # Addition ends here!
    process_character(text.slice!(0, 1), text, pos) until text.empty?
  end
 
end
This will add that 1st line check that's missing from the scrolling text window.

Original thread: https://forums.rpgmakerweb.com/threads/ats-formatting-scrolltext-bug-rmvxa.130967/