设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1299|回复: 11
打印 上一主题 下一主题

名字中显示不出韩文么?

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
45
在线时间
43 小时
注册时间
2006-10-6
帖子
179
跳转到指定楼层
1
发表于 2008-9-17 08:05:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
我以为自己没有韩文字体,结果添加了字体到fonts,我以为是改语言和区域设置,添加了朝鲜文。但是好像还索不行额,选韩文的时候就是一个个空的额。请高手帮帮忙。555555


#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


class Scene_Name
  # -------------------------
  def main
    @actor = $game_actors[$game_temp.name_actor_id]
    @edit_window = Window_NameEdit.new(@actor, $game_temp.name_max_char)
    @input_window = Window_NameInput.new
    @alert_window = Window_Base.new(188, 208, 264, 64)
    @alert_window.contents = Bitmap.new(228, 32)
    @alert_window.contents.font.name = "黑体"
    @alert_window.contents.font.size = 24
    @alert_window.contents.draw_text(0, 0, 228, 32, "你必须输入一个名字")
    @alert_window.z = 1001
    @alert_window.visible = false
    c1 = " 输入英文"
    c2 = " 输入韩文"
    c3 = " 输入中文"
    c4 = "   空格"
    c5 = "   退格"
    c6 = " 默认姓名"
    c7 = "   确定"
    commands = [c1, c2, c3, c4, c5, c6, c7]
    @command_window = Window_NameCommand.new(160, commands)
    @input_window.active = false
    @input_window.visible = true
    @command_window.index = 0
    @command_window.visible = true
    @command_window.active = true
    @command_window.x = 0
    @command_window.y = 128
    @command_window.z = 1000
    @alert_count = 0
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @edit_window.dispose
    @input_window.dispose
    @command_window.dispose
    @alert_window.dispose
  end
  # -------------------------
  def update
    @edit_window.update
    @input_window.update
    @command_window.update
    @alert_window.update
    if @alert_window.visible == true && @alert_count > 0
      @alert_count -= 1
      if @alert_count <= 0
        @command_window.active = true
        @alert_window.visible = false
      end
    return
    end
    if @input_window.active == false
      @command_window.active = true
    end
    if @command_window.active == false
      @input_window.active = true
    end
    if Input.repeat?(Input::B) && @input_window.active == true
      if @edit_window.index == 0
        return
      else
      $game_system.se_play($data_system.cancel_se)
      @edit_window.back
      end
    end
    if Input.repeat?(Input::B) && @command_window.active == true
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    if Input.trigger?(Input::C)
      if @command_window.active == true
        case @command_window.index
        when 0
        $game_system.se_play($data_system.decision_se)
        @input_window.mode = 1
        @input_window.refresh
        @command_window.active = false
        @input_window.active = true
        @input_window.index = 0
        return
        when 1
        $game_system.se_play($data_system.decision_se)
        @input_window.mode = 2
        @input_window.refresh
        @command_window.active = false
        @input_window.active = true
        @input_window.index = 0
        return
        when 2
        $game_system.se_play($data_system.decision_se)
        @input_window.mode = 3
        @input_window.refresh
        @command_window.active = false
        @input_window.active = true
        @input_window.index = 0
        return
        when 3
        if @edit_window.index < $game_temp.name_max_char
          $game_system.se_play($data_system.decision_se)
          @edit_window.add(" ")
        else
          $game_system.se_play($data_system.buzzer_se)
        end
        return
        when 4
        $game_system.se_play($data_system.decision_se)
        @edit_window.back
        return
        when 5
        $game_system.se_play($data_system.decision_se)
        @edit_window.restore_default
        return
        when 6
        if @edit_window.name == ""
          $game_system.se_play($data_system.buzzer_se)
          @alert_window.visible = true
          @command_window.active = false
          @alert_count = 60
          return
        end
          $game_system.se_play($data_system.decision_se)
          @actor.name = @edit_window.name
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Map.new
          return
        end
       end
      if @edit_window.index == $game_temp.name_max_char &&
        @input_window.active == true
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if @input_window.character == "" && @input_window.active == true
        $game_system.se_play($data_system.buzzer_se)
        return
      end
     if @input_window.character != nil && @input_window.active == true &&
        @edit_window.index <= $game_temp.name_max_char
      $game_system.se_play($data_system.decision_se)
      if @input_window.mode == 1
        @edit_window.char_type[@edit_window.index] = 1
      else
        @edit_window.char_type[@edit_window.index] = 2
      end
      @edit_window.add(@input_window.character)
      end
      return
      end
  end
end




class Window_NameEdit < Window_Base
  # ---------------------------
  attr_accessor :char_type
  attr_reader   :name
  attr_reader   :index
  # ---------------------------
  def initialize(actor, max_char)
    super(0, 0, 640, 128)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    @name = actor.name
    @max_char = max_char
    @char_type = []
    name_array = @name.split(//)[0...@max_char]
    @name = ""
    for i in 0...name_array.size
      @name += name_array
      @char_type = 1
    end
    @default_name = @name
    @index = name_array.size
    refresh
    update_cursor_rect
  end
  # ---------------------------
  def restore_default
    @name = @default_name
    for i in 0..@default_name.size
       @char_type = 1
    end
    @index = @name.split(//).size
    refresh
    update_cursor_rect
  end
  # ---------------------------
  def add(character)
    if @index < @max_char and character != ""
      @name += character
      @index += 1
      refresh
      update_cursor_rect
    end
  end
  # ---------------------------
  def back
    if @index > 0
      name_array = @name.split(//)
      @name = ""
      for i in 0...name_array.size-1
        @name += name_array
      end
      @index -= 1
      refresh
      update_cursor_rect
    end
  end
  # ---------------------------
  def refresh
    self.contents.clear
    name_array = @name.split(//)
    for i in 0...@max_char
      c = name_array
      if c == nil
        c = "_"
      end
      x = 320 - @max_char * 14 + i * 28
      if @char_type == 1
        self.contents.font.name = "黑体"
        self.contents.font.size = 24
      else
        self.contents.font.name = "黑体"
        self.contents.font.size = 22
      end
      self.contents.draw_text(x, 32, 28, 32, c, 1)
    end
    draw_actor_graphic(@actor, 320 - @max_char * 14 - 40, 80)
  end
  # ---------------------------
  def update_cursor_rect
    x = 320 - @max_char * 14 + @index * 28
    self.cursor_rect.set(x, 32, 28, 32)
  end
  # ---------------------------
  def update
    super
    update_cursor_rect
  end
end




class Window_NameInput < Window_Base
  # ----------------------------------
  attr_accessor :mode
  # ----------------------------------
  ENGLISH_TABLE =
  [
    "A","B","C","D","E",
    "F","G","H","I","J",
    "K","L","M","N","O",
    "P","Q","R","S","T",
    "U","V","W","X","Y",
    "Z","","","","",
    "0","1","2","3","4",
    "5", "6" ,"7", "8" ,"9",
    "","","","","",
    "a", "b" ,"c", "d" ,"e",
    "f","g","h","i","j",
    "k","l","m","n","o",
    "p","q","r","s","t",
    "u","v","w","x","y",
    "z","","","","",
    ".",",","?","!","/",
    "\\","<",">",";",":",
    "","", "" , "" , "" ,
    "@","#","$","%","^",
    "&","*","(",")","",
    "[","]","'","\"","~",
     "★","■","●","◆","▲",
    "","","","","",
    "","","","","",
    "","","","","",
    "","","","","",
    "", "" ,"", "" ,"",
   
  ]
  HIRAGANA_TABLE =
  [
    "이","특","희","철","한",
    "경","예","성","강","인",
    "신","동","성","민","은",
    "혁","동","해","시","원",
    "려","욱","기","범","규",
    "현","곡","구","へ","장",
    "왕","이","조","손","전",
    "송","우","묘","량","김",
    "정","하","문","렴","봉",
    "안","양","진","동","림",
    "애","진","백","허","서",
    "소","사","범","정","왕",
    "대","고","등","니","축",
    "로","부","범","구","엽",
    "당","우","반","조","증",
    "왕","만","소","은","몽",
    "제","기","언","담","로",
    "녕","요","교","상","호" ,
    "륙","려","신","초","류",
    "배","려","주","장","초",
    "문","로","채","이","온",
    "시","방","거","사","만",
    "엄","방","등","신","위",
    "단","관","총","","",
    "","","","","",
    "","","","","",
    "","","","","",
    "","","","","",
  ]
  KATAKANA_TABLE =
  [
    "赵","钱","孙","李","百",
    "周","吴","郑","王","家",
    "南","方","爵","龙","天",
    "夏","大","家","看","着",
    "吧","安","也","想","不",
    "出","啥","嘿","懒","么",
    "朱","蓝","亲","正","宫",
    "利","特" ,"强", "仁" ,"奎",
    "贤","晟","敏","艺","声",
    "丽","旭" ,"东", "海" ,"恩",
    "赫","神","童","始","源",
    "基","范","希","澈","韩",
    "庚","花","瓣","妖","精",
    "请","不","要","取","十",
    "三","只","的","名","·",
    "因","为","他","们","可",
    "能","会","在","游","戏",
    "中","出","现", "防" , "止" ,
    "撞","车","请","配","合",
    "哦","惜","我","手","酸",
    "类","再","来","点","咋",
    "还","没","满","@","_",
    "雷","泪","蕾","涙","儡",
    "幽","眸","月","饼","僵",
    "莉","萨","柩","紫","楽",
    "甲","佑","侠","冕","莱",
    "殿","腐","灏","女","狼",
    "","","","","",
  ]
  # ----------------------------------
  def initialize
    super(160, 128, 480, 352)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.active = false
    @index = -1
    @mode = 1
    refresh
    update_cursor_rect
  end
  # ----------------------------------
  def index=(value)
    @index = value
    update_cursor_rect
  end
  #--------------------------------------
  def character
    if @mode == 1
    return ENGLISH_TABLE[@index]
  elsif @mode == 2
    return HIRAGANA_TABLE[@index]
  else
    return KATAKANA_TABLE[@index]
    end
  end
  # ----------------------------------
  def refresh
    self.contents.clear
    for i in 0..134
      x = 4 + i / 5 / 9 * 152 + i % 5 * 28
      y = i / 5 % 9 * 32
      if @mode == 1
      self.contents.font.name = "黑体"
      self.contents.font.size = 24
      self.contents.draw_text(x, y, 28, 32, ENGLISH_TABLE, 1)
    elsif @mode == 2
      self.contents.font.name = "黑体"
      self.contents.font.size = 22
      self.contents.draw_text(x, y, 28, 32, HIRAGANA_TABLE, 1)
    else
      self.contents.font.name = "黑体"
      self.contents.font.size = 22
      self.contents.draw_text(x, y, 28, 32, KATAKANA_TABLE, 1)
      end
    end
  end
  # ----------------------------------
  def update_cursor_rect
    if self.active == false
      self.cursor_rect.empty
    else
      x = 4 + @index / 5 / 9 * 152 + @index % 5 * 28
      y = @index / 5 % 9 * 32
      self.cursor_rect.set(x, y, 28, 32)
    end
  end
  # ----------------------------------
  def update
    super
    if @index >= 0 && @index <= 134
      if Input.repeat?(Input::RIGHT)
        $game_system.se_play($data_system.cursor_se)
          if @index % 5 == 4
            if @index < 94
              @index += 41
            end
          else
            @index += 1
          end
        end
      if Input.repeat?(Input::LEFT)
        $game_system.se_play($data_system.cursor_se)
          if @index % 5 == 0
            if @index < 45
              self.active = false
              @index = -999
              return
            else
              @index -= 41
            end
          else
            @index -= 1
          end
      end
      if Input.repeat?(Input::DOWN)
        $game_system.se_play($data_system.cursor_se)
        if @index % 45 < 40
          @index += 5
        end
      end
      if Input.repeat?(Input::UP)
        if Input.trigger?(Input::UP) or @index % 45 >= 5
          $game_system.se_play($data_system.cursor_se)
          if @index % 45 >= 5
            @index -= 5
          end
        end
      end
    end
    update_cursor_rect
  end
end




class Window_NameCommand < Window_Command
# -------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      if i == 1 or i == 2
        font = 1
        self.contents.font.name = "黑体"
        self.contents.font.size = 22
      else
        font = 0
        self.contents.font.name = "黑体"
        self.contents.font.size = 24
      end
      draw_item(i, normal_color, font)
    end
  end
# -------------------------------
def draw_item(index, color, f)
  if f == 0
    self.contents.font.color = color
    self.contents.font.name = "黑体"
    self.contents.font.size = 24
  else
    self.contents.font.name = "黑体"
    self.contents.font.size = 22
  end
    rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
  end
end

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================



此贴于 2008-9-18 18:19:57 被版主darkten提醒,请楼主看到后对本贴做出回应。
移动硬盘坏了 好多好多好东西都没了 哭死啊 于是我发飙了 把电脑也重装了 干脆啥都没有重新开始 哼

Lv1.梦旅人

梦石
0
星屑
45
在线时间
43 小时
注册时间
2006-10-6
帖子
179
2
 楼主| 发表于 2008-9-17 08:10:41 | 只看该作者
啊,怎么会这样?我明明是

唉。。。不懂了。
移动硬盘坏了 好多好多好东西都没了 哭死啊 于是我发飙了 把电脑也重装了 干脆啥都没有重新开始 哼
回复 支持 反对

使用道具 举报

Lv1.梦旅人

逃兵

3
发表于 2008-9-17 18:48:34 | 只看该作者
把韩文的文字版帖上来吧
「If you judge people, you have no time to love them.」—— Mother Teresa
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
70
在线时间
386 小时
注册时间
2007-7-27
帖子
4106

开拓者

4
发表于 2009-6-12 08:00:00 | 只看该作者
……把那些黑体全换成韩文字体的名字行么……
吸吸
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
45
在线时间
43 小时
注册时间
2006-10-6
帖子
179
5
 楼主| 发表于 2008-9-17 22:26:03 | 只看该作者
好像不行额,这次韩文没有字,中文都没了额。

我韩文版贴上来就变成돋음了。555,哭死,怎么办啊?
移动硬盘坏了 好多好多好东西都没了 哭死啊 于是我发飙了 把电脑也重装了 干脆啥都没有重新开始 哼
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
70
在线时间
386 小时
注册时间
2007-7-27
帖子
4106

开拓者

6
发表于 2008-9-17 22:36:03 | 只看该作者
那啥,用一个Unicode字体吧,就是同时有中文和韩文的那种
系统信息:本贴获得楼主认可,66RPG感谢您的热情解答~
吸吸
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
45
在线时间
43 小时
注册时间
2006-10-6
帖子
179
7
 楼主| 发表于 2008-9-18 00:32:55 | 只看该作者
再问一个比较小白的问题哦,呵呵。

它字体名是Athena Unicode ,文件名是athena_u.TTF

那我
elsif @mode == 2
     self.contents.font.name = "黑体"
把黑体改成什么呢?是Athena Unicode还索athena_u?
移动硬盘坏了 好多好多好东西都没了 哭死啊 于是我发飙了 把电脑也重装了 干脆啥都没有重新开始 哼
回复 支持 反对

使用道具 举报

Lv2.观梦者

神隐的主犯

梦石
0
星屑
299
在线时间
271 小时
注册时间
2008-2-22
帖子
7691

贵宾

8
发表于 2008-9-18 00:38:36 | 只看该作者
应该是 athena_u 。

LZ 可以去试试。{/hx}

《天空之城 —— 破碎的命运》
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
45
在线时间
43 小时
注册时间
2006-10-6
帖子
179
9
 楼主| 发表于 2008-9-18 01:32:16 | 只看该作者
额,还索不行额,两个都试过了还索不行。唉。。。。
移动硬盘坏了 好多好多好东西都没了 哭死啊 于是我发飙了 把电脑也重装了 干脆啥都没有重新开始 哼
回复 支持 反对

使用道具 举报

Lv1.梦旅人

劒剋

梦石
0
星屑
50
在线时间
27 小时
注册时间
2007-12-16
帖子
1304
10
发表于 2008-9-18 02:10:06 | 只看该作者
韩文字体:
GungsuhChe
Gungsuh
GulimChe
Gulim
DotumChe
Dotum
BatangChe
Batang

里面也有中文……但是是繁体的……
Shining...
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-1-12 17:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表