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

Project1

 找回密码
 注册会员
搜索

【已解决】开始画面需要一些帮助..

查看数: 2156 | 评论数: 4 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2016-9-2 22:24

正文摘要:

本帖最后由 phunmung5173 于 2016-9-3 15:00 编辑 如上图 我需要修改 1)标题的坐标 2)Menu的坐标 (在script找不到类似可以改的>.<) 3)(最主要) 我想要每次开游戏都随机背景 (预设三个图) ...

回复

phunmung5173 发表于 2016-9-3 15:00:17
雪在燃 发表于 2016-9-3 10:21
Scene_Title 里

这里的代码是标题的生成,通过修改

谢谢解答w
很实用

话说版内搜寻去哪了阿..{:2_276:}
找了老半天....
雪在燃 发表于 2016-9-3 10:21:50
本帖最后由 雪在燃 于 2016-9-3 10:22 编辑

Scene_Title 里
  1.   #--------------------------------------------------------------------------
  2.   # ● 生成前景
  3.   #--------------------------------------------------------------------------
  4.   def create_foreground
  5.     @foreground_sprite = Sprite.new
  6.     @foreground_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
  7.     @foreground_sprite.z = 100
  8.     draw_game_title if $data_system.opt_draw_title
  9.   end
  10.   #--------------------------------------------------------------------------
  11.   # ● 绘制游戏标题
  12.   #--------------------------------------------------------------------------
  13.   def draw_game_title
  14.     @foreground_sprite.bitmap.font.size = 48
  15.     rect = Rect.new(0, 0, Graphics.width, Graphics.height / 2)
  16.     @foreground_sprite.bitmap.draw_text(rect, $data_system.game_title, 1)
  17.   end
复制代码

这里的代码是标题的生成,通过修改
rect = Rect.new(x, y, Graphics.width, Graphics.height / 2)  这里的x,y可以改变坐标

Window_TitleCommand

  1.   #--------------------------------------------------------------------------
  2.   # ● 更新窗口的位置
  3.   #--------------------------------------------------------------------------
  4.   def update_placement
  5.     self.x = (Graphics.width - width) /2
  6.     self.y = (Graphics.height * 1.6 - height) / 2
  7.   end
复制代码

修改x y 就能随意挪动了

  1. module Cache
  2.   def self.title()
  3.     v = ["one.png","two.png","three.png"]
  4.     load_bitmap("Graphics/Titles1/", v[rand(2)])
  5.   end
  6. end
  7. class Scene_Title
  8.   alias randTitle_create_background create_background
  9.     def create_background
  10.     randTitle_create_background
  11.     @sprite1.bitmap = Cache.title()
  12.   end
  13. end
复制代码

把这个插入到main前,然后在titles1文件夹下创建one.png two.png three.png三张图片
然后rm就会随机标题画面了

评分

参与人数 1星屑 +250 梦石 +1 收起 理由
RaidenInfinity + 250 + 1 楼主认可的解答

查看全部评分

phunmung5173 发表于 2016-9-3 00:09:30
翠靈月 发表于 2016-9-2 22:45
可以考虑改作成事件标题,再用随机变量来变换标题画面

这个方法不错但是跳过原本的标题画面, 随机出我要的背景过后
有没有办法再召唤出默认出现在开始画面的窗口(而不是伪造出一个)
翠靈月 发表于 2016-9-2 22:45:03
可以考虑改作成事件标题,再用随机变量来变换标题画面
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-5-2 07:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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