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

Project1

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

[已经解决] 我没事做了个图片菜单,有问题

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
38 小时
注册时间
2006-2-16
帖子
117
跳转到指定楼层
1
发表于 2011-8-2 17:59:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------
#  处理菜单画面的类。
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     menu_index : 命令光标的初期位置
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
  @xuanxiang = Sprite.new
  @xuanxiang.bitmap = Bitmap.new("Graphics/Pictures/菜单选项")
  @xuanxiang.x = 0
  @xuanxiang.y = 0
  case @menu_index
    when 0
      @xuanxiang1 = Sprite.new
  @xuanxiang1.bitmap = Bitmap.new("Graphics/Pictures/物品")
  @xuanxiang1.x = 0
  @xuanxiang1.y = 0
    when 1
      @xuanxiang1 = Sprite.new
  @xuanxiang1.bitmap = Bitmap.new("Graphics/Pictures/特技")
  @xuanxiang1.x = 0
  @xuanxiang1.y = 0  
    when 2
      @xuanxiang1 = Sprite.new
  @xuanxiang1.bitmap = Bitmap.new("Graphics/Pictures/装备")
  @xuanxiang1.x = 0
  @xuanxiang1.y = 0
    when 3
      @xuanxiang1 = Sprite.new
  @xuanxiang1.bitmap = Bitmap.new("Graphics/Pictures/状态")
  @xuanxiang1.x = 0
  @xuanxiang1.y = 0
    when 4
      @xuanxiang1 = Sprite.new
  @xuanxiang1.bitmap = Bitmap.new("Graphics/Pictures/存档")
  @xuanxiang1.x = 0
  @xuanxiang1.y = 0
    when 5
  @xuanxiang1 = Sprite.new
  @xuanxiang1.bitmap = Bitmap.new("Graphics/Pictures/结束")
  @xuanxiang1.x = 0
  @xuanxiang1.y = 0
    end
    # 执行过渡
    Graphics.transition
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      qiehuan
      # 刷新画面
      quxiao
      # 如果切换画面就中断循环
      if  $game_variables[11] != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
  # 释放窗口
  @xuanxiang.dispose
  @xuanxiang1.dispose
end
def quxiao
      if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      # 切换的地图画面
      $game_variables[11]+=1
      $scene = Scene_Map.new
      $game_variables[11]=0
      return
    end #条件的
  end #定义的
  def qiehuan
  # 方向键下被按右的情况下
        if Input.trigger?(Input::RIGHT)
          $game_system.se_play($data_system.cursor_se)
          if @menu_index< 5
            @menu_index+=1  
          else
            @menu_index=0
          end
          return
      end
      # 方向键上被按左的情况下
        if Input.trigger?(Input::LEFT)
          $game_system.se_play($data_system.cursor_se)
       if @menu_index>0
            @menu_index-=1
          else
            @menu_index=5
          end
          return
        end
  end#定义的
end #类的
  #--------------------------------------------------------------------------

我在菜单中按左右键时候,有时没反应,有时反应很慢,然而6R论坛中置顶的贴中的”图片标题菜单“就没这样,难道只有标题才能这么做吗?这是怎么回事。

点评

[code][/code]  发表于 2011-8-2 19:02
在王宫中,张笑忽然站了起来,拔出了夜之哀伤之剑,走向国王-他的父亲,将夜之哀伤之剑刺入了他的身体。

Lv1.梦旅人

虱子

梦石
0
星屑
121
在线时间
1782 小时
注册时间
2010-6-19
帖子
3597
2
发表于 2011-8-2 19:03:08 | 只看该作者
粗略观看是因为刷新图片只在进入场景时有一次,

http://rpg.blue/thread-175056-1-2.html
PVZ型塔防物一个
http://rpg.blue/thread-155199-1-2.html
RMXP技术讨论区手动认可帖,得到答案请认可
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
38 小时
注册时间
2006-2-16
帖子
117
3
 楼主| 发表于 2011-8-4 11:09:36 | 只看该作者
Wind2010 发表于 2011-8-2 19:03
粗略观看是因为刷新图片只在进入场景时有一次,

不好意思,这两天出了个远门,我现在回来了,继续提问下,朋友,我还应该在什么地方刷新呢

点评

qiehuan和quxiao全部放到新定义update里刷新,index刷新也放进去  发表于 2011-8-4 11:54
在王宫中,张笑忽然站了起来,拔出了夜之哀伤之剑,走向国王-他的父亲,将夜之哀伤之剑刺入了他的身体。
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
486 小时
注册时间
2009-7-23
帖子
449
4
发表于 2011-8-4 11:19:54 | 只看该作者
可以参考“汉之云菜单修正”这个范例。
其实用公共事件也可以啊。
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-14 19:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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