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??
Adding or removing a space in between the control chara and text does nothing.
that is not what the description of the textcode says. I followed the link you gave and the description reads:
You would be right in that, that's what the script says, but it actually works for the entire message.
No thanks for the blank line! It looks really ugly hahahaha
So you gave me a demo and I made a small change and it worked.
class Window_ScrollText
def start_message
@text = $game_message.all_text
@text = "\n" + @text
refresh
show
end
end
ats_all(:ats_alignment, 0/1/2)
ats_next(:ats_alignment, 0/1/2)
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.
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
Original thread: https://forums.rpgmakerweb.com/threads/ats-formatting-scrolltext-bug-rmvxa.130967/