irpg Community

Full Version: บอกวิธีแก้สระลอย+ซ้อน+ห่างหน่อยครับ
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
คือที่เห็นนี้มีแต่เอาscriptไปทับอันเก่าแล้วมันจะแก้ได้แต่ผมเขียนscriptไประดับนึงแล้วอะครับเลยไม่อยากเขียนใหม่ใครรู้วิธีแก้แบบไม่ต้องเอาscriptไปทับบ้างครับ?
Code:
class Window_Base < Window
  @@thai_vovel = "qิีึืุู่้๊๋์ํฺ" # ลบ q ออกด้วย
  #--------------------------------------------------------------------------
  # * 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
    pos[:x] -= text_width if @@thai_vovel.include?(c)
    draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
    pos[:x] += text_width
  end
end

ลองดูนะ (อย่างง่าย) ถ้าที่เขียนมาเกี่ยวข้องกับข้างบนก็ลองประยุกต์ดูนะ
ขอบคุณมากครับ ภาษาไทยอ่านรู้เรื่องซักที..
ลองก่อนนะ (เพราะคิดเองเหมือนกัน)
ขอบคุณเป็นอย่างสูง (_A_)