查看: 2026|回复: 2

[已经解决] 古代纵版文字描绘使用求教

[复制链接]
梦石
0
星屑
72
在线时间
320 小时
注册时间
2011-8-30
回帖
114
发表于 2013-9-5 14:00:21 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 fm303018 于 2013-9-7 02:45 编辑

QQ图片20130905135504.jpg
古代纵版文字描绘
希望文字描绘由横向变成纵向
http://www.66rpg.com/articles/3291
有脚本可是根本看不懂
有会的朋友写个简单的范例学习下好吗?



求个数字123456789 换为一二三四五六七八九  xp版

点评

如果我没记错的话,七夕小雨前辈写了一个武林的菜单  发表于 2013-9-6 06:35
天之痕同人游戏填坑中
游戏名称: 天之痕前传
游戏进度: 百分之二十  
游戏素材: 素材制作中。。。
游戏脚本: 百分之九十九
游戏剧本: 百分之五
梦石
0
星屑
3905
在线时间
1972 小时
注册时间
2013-1-3
回帖
9146
发表于 2013-9-5 20:57:19 | 显示全部楼层
这个脚本不是插件脚本,而是要在脚本里自行添加
PS:这不是武林群侠传吗?假期时候刚玩通关

点评

就是不会才求教啊  发表于 2013-9-5 21:40
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复

使用道具 举报

薄凉看客

梦石
0
星屑
50
在线时间
1269 小时
注册时间
2010-6-20
回帖
1223
发表于 2013-9-7 14:35:51 | 显示全部楼层
至于文字。。其实改下坐标描绘上两次就可以了。。
脚本测试下就知道是干什么的了(纵版命令窗体选项):
[pre lang="ruby" line="1"]#==============================================================================
# ■ Window_Command
#------------------------------------------------------------------------------
#  一般的命令选择行窗口。
#==============================================================================

class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     width    : 窗口的宽
  #     commands : 命令字符串序列
  #--------------------------------------------------------------------------
  def initialize(width, commands, type = "一般窗口")
    # 由命令的个数计算出窗口的高
    super(0, 0, width, commands.size * 32 + 32)
    @item_max = commands.size
    @commands = commands
    @type = type
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    if type == "菜单"
    @column_max = 3
    end
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @type == "菜单"
    self.contents.draw_text(width / @column_max * 0 + 12, 32,
    width - 8, 32, "游")
    self.contents.draw_text(width / @column_max * 0 + 12, 64,
    width - 8, 32, "戏")
    self.contents.draw_text(width / @column_max * 1 + 12, 64,
    width - 8, 32, "续")
    self.contents.draw_text(width / @column_max * 2 + 12, 64,
    width - 8, 32, "出")
    end
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # ● 描绘项目
  #     index : 项目编号
  #     color : 文字色
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    #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])
    if @type == "菜单"
      self.contents.draw_text(width / @column_max * index + 12, 0,
      width - 8, 32, @commands[index])
    else
      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
  #--------------------------------------------------------------------------
  # ● 项目无效化
  #     index : 项目编号
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
  #--------------------------------------------------------------------------
  # ● 更新光标矩形
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @type == "菜单"
    self.cursor_rect.set(width / @column_max * index, 0, 250 / 3 - 32, 96)
    else
    super
    end
  end
end

#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
#  处理标题画面的类。
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
    # 战斗测试的情况下
    if $BTEST
      battle_test
      return
    end
    # 载入数据库
    $data_actors        = load_data("Data/Actors.rxdata")
    $data_classes       = load_data("Data/Classes.rxdata")
    $data_skills        = load_data("Data/Skills.rxdata")
    $data_items         = load_data("Data/Items.rxdata")
    $data_weapons       = load_data("Data/Weapons.rxdata")
    $data_armors        = load_data("Data/Armors.rxdata")
    $data_enemies       = load_data("Data/Enemies.rxdata")
    $data_troops        = load_data("Data/Troops.rxdata")
    $data_states        = load_data("Data/States.rxdata")
    $data_animations    = load_data("Data/Animations.rxdata")
    $data_tilesets      = load_data("Data/Tilesets.rxdata")
    $data_common_events = load_data("Data/CommonEvents.rxdata")
    $data_system        = load_data("Data/System.rxdata")
    # 生成系统对像
    $game_system = Game_System.new
    # 生成标题图形
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
    # 生成命令窗口
    s1 = "新"#游戏
    s2 = "继"#续
    s3 = "退"#出
    @command_window = Window_Command.new(250, [s1, s2, s3], "菜单")
    @command_window.back_opacity = 160
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 288
    # 判定继续的有效性
    # 存档文件一个也不存在的时候也调查
    # 有効为 @continue_enabled 为 true、无效为 false
    @continue_enabled = false
    for i in 0..3
      if FileTest.exist?("Save#{i+1}.rxdata")
        @continue_enabled = true
      end
    end
    # 继续为有效的情况下、光标停止在继续上
    # 无效的情况下、继续的文字显示为灰色
    if @continue_enabled
      @command_window.index = 1
    else
      @command_window.disable_item(1)
    end
    # 演奏标题 BGM
    $game_system.bgm_play($data_system.title_bgm)
    # 停止演奏 ME、BGS
    Audio.me_stop
    Audio.bgs_stop
    # 执行过渡
    Graphics.transition
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      Input.update
      # 刷新画面
      update
      # 如果画面被切换就中断循环
      if $scene != self
        break
      end
    end
    # 装备过渡
    Graphics.freeze
    # 释放命令窗口
    @command_window.dispose
    # 释放标题图形
    @sprite.bitmap.dispose
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    # 刷新命令窗口
    @command_window.update
    # 按下 C 键的情况下
    if Input.trigger?(Input::C)
      # 命令窗口的光标位置的分支
      case @command_window.index
      when 0  # 新游戏
        command_new_game
      when 1  # 继续
        command_continue
      when 2  # 退出
        command_shutdown
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 命令 : 新游戏
  #--------------------------------------------------------------------------
  def command_new_game
    # 演奏确定 SE
    $game_system.se_play($data_system.decision_se)
    # 停止 BGM
    Audio.bgm_stop
    # 重置测量游戏时间用的画面计数器
    Graphics.frame_count = 0
    # 生成各种游戏对像
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_actors        = Game_Actors.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    # 设置初期同伴位置
    $game_party.setup_starting_members
    # 设置初期位置的地图
    $game_map.setup($data_system.start_map_id)
    # 主角向初期位置移动
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    # 刷新主角
    $game_player.refresh
    # 执行地图设置的 BGM 与 BGS 的自动切换
    $game_map.autoplay
    # 刷新地图 (执行并行事件)
    $game_map.update
    # 切换地图画面
    $scene = Scene_Map.new
  end
  #--------------------------------------------------------------------------
  # ● 命令 : 继续
  #--------------------------------------------------------------------------
  def command_continue
    # 继续无效的情况下
    unless @continue_enabled
      # 演奏无效 SE
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    # 演奏确定 SE
    $game_system.se_play($data_system.decision_se)
    # 切换到读档画面
    $scene = Scene_Load.new
  end
  #--------------------------------------------------------------------------
  # ● 命令 : 退出
  #--------------------------------------------------------------------------
  def command_shutdown
    # 演奏确定 SE
    $game_system.se_play($data_system.decision_se)
    # BGM、BGS、ME 的淡入淡出
    Audio.bgm_fade(800)
    Audio.bgs_fade(800)
    Audio.me_fade(800)
    # 退出
    $scene = nil
  end
  #--------------------------------------------------------------------------
  # ● 战斗测试
  #--------------------------------------------------------------------------
  def battle_test
    # 载入数据库 (战斗测试用)
    $data_actors        = load_data("Data/BT_Actors.rxdata")
    $data_classes       = load_data("Data/BT_Classes.rxdata")
    $data_skills        = load_data("Data/BT_Skills.rxdata")
    $data_items         = load_data("Data/BT_Items.rxdata")
    $data_weapons       = load_data("Data/BT_Weapons.rxdata")
    $data_armors        = load_data("Data/BT_Armors.rxdata")
    $data_enemies       = load_data("Data/BT_Enemies.rxdata")
    $data_troops        = load_data("Data/BT_Troops.rxdata")
    $data_states        = load_data("Data/BT_States.rxdata")
    $data_animations    = load_data("Data/BT_Animations.rxdata")
    $data_tilesets      = load_data("Data/BT_Tilesets.rxdata")
    $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
    $data_system        = load_data("Data/BT_System.rxdata")
    # 重置测量游戏时间用的画面计数器
    Graphics.frame_count = 0
    # 生成各种游戏对像
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_actors        = Game_Actors.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    # 设置战斗测试用同伴
    $game_party.setup_battle_test_members
    # 设置队伍 ID、可以逃走标志、战斗背景
    $game_temp.battle_troop_id = $data_system.test_troop_id
    $game_temp.battle_can_escape = true
    $game_map.battleback_name = $data_system.battleback_name
    # 演奏战斗开始 BGM
    $game_system.se_play($data_system.battle_start_se)
    # 演奏战斗 BGM
    $game_system.bgm_play($game_system.battle_bgm)
    # 切换到战斗画面
    $scene = Scene_Battle.new
  end
end
[/pre]

点评

[url=home.php?mod=space&uid=114926]@sprite[/url] = Sprite.new报错  发表于 2013-9-7 23:26
我要全部系统字体纵排列 且不影响Window_Selectable 格式 开始菜单不要做了 图片菜单  发表于 2013-9-7 23:23
放哪里啊  发表于 2013-9-7 23:20
报错的那句是@sprite = Sprite.new  发表于 2013-9-7 14:40

评分

参与人数 1星屑 +112 收起 理由
弗雷德 + 112 认可答案

查看全部评分

回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部