#============================================================================== # แก้สระลอยใน RmVX Ace # by OP_Jum_RPG # ถ้าใช้ไม่ได้ ให้ลง Script Thai ก่อนครับ #============================================================================== # ** แก้ไขจากสคริปต์ Message Thai Vovel and Outline Fix # By : Admannon # https://irpg.in.th/thread-1066.html #============================================================================== #============================================================================== # ** Window Base #============================================================================== class Window_Base < Window @@thai_vovel = "่้ัิีึื่้๊๋็์ุูํฺ" #-------------------------------------------------------------------------- # * Preconvert Control Characters #-------------------------------------------------------------------------- alias thai_fix_convert_escape_characters convert_escape_characters unless $@ def convert_escape_characters(text) result = thai_fix_convert_escape_characters(text).clone result.gsub!(/ำ/) { "ํา" } result end #-------------------------------------------------------------------------- # * Normal Character Processing #-------------------------------------------------------------------------- def process_normal_character(c, pos) text_width = text_size(c).width text_height = text_size(c).height if c=="่" draw_text(pos[:x]+text_width, pos[:y]-text_height*0.15, text_width, pos[:height], c) elsif c=="้" or c=="์" draw_text(pos[:x]+text_width*0.8, pos[:y]-text_height*0.15, text_width, pos[:height], c) elsif c=="๊" or c=="๋" draw_text(pos[:x], pos[:y]-text_height*0.15, text_width*2, pos[:height], c) else draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c) end pos[:x] += text_width unless @@thai_vovel.include?(c) end end #============================================================================== # ** Bitmap #============================================================================== class Bitmap alias outline_fix_draw_text draw_text unless $@ def draw_text(*args) s = text_size(" ").width a = args.size - (args[args.size - 1].is_a?(String) ? 1 : 2) args[a] = " " + args[a].to_s if args[0].is_a?(Rect) args[0].x -= s args[0].width += s else args[0] -= s args[2] += s end outline_fix_draw_text(*args) end end