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

Project1

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

[已经解决] (已经解决)怎么做让窗口移动的效果?

[复制链接]

Lv2.观梦者

梦石
0
星屑
382
在线时间
41 小时
注册时间
2019-4-14
帖子
13
跳转到指定楼层
1
发表于 2021-3-23 17:55:45 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 muffethb 于 2021-11-20 16:54 编辑

如题,,,

Lv5.捕梦者

梦石
0
星屑
24494
在线时间
5086 小时
注册时间
2016-3-8
帖子
1623
2
发表于 2021-3-23 18:08:48 | 只看该作者
本帖最后由 alexncf125 于 2021-3-23 18:29 编辑

https://viparcher.github.io/Hexo ... %E7%BE%8E%E5%8C%96/
RUBY 代码复制
  1. #==============================================================================
  2. # ■ VA菜单滑动
  3. #  创意:百页书香,铅笔描绘的思念
  4. # By :VIPArcher [email: [email protected]]
  5. #  -- 本脚本来自 [url]http://rm.66rpg.com[/url] 使用或转载请保留以上信息。
  6. #==============================================================================
  7. # 这里只有默认的主菜单和物品栏,其他窗口也是同样的方法。
  8. # 具体请自己设置。一点难度都没有,依葫芦画瓢就可以了。
  9. #==============================================================================
  10. $VIPArcherScript ||= {};$VIPArcherScript[:menu_slide] = 20141215
  11. #==============================================================================
  12. # ■ 下面Scene_Base部分最好不要动,新场景写在最下方
  13. #==============================================================================
  14. class Scene_Base
  15.   #--------------------------------------------------------------------------
  16.   # ● 开始后处理
  17.   #--------------------------------------------------------------------------
  18.   alias vip_slide_post_start post_start
  19.   def post_start
  20.     init_slide
  21.     vip_slide_post_start
  22.     slide_start
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 滑动前的准备
  26.   #--------------------------------------------------------------------------
  27.   def init_slide ; end
  28.   #--------------------------------------------------------------------------
  29.   # ● 窗口滑动处理
  30.   #--------------------------------------------------------------------------
  31.   def slide_start ; end
  32. end
  33. #-------------------------------------------------------------------------------
  34. # ■ 上面部分最好不要改
  35. #==============================================================================
  36. #  菜单画面
  37. #==============================================================================
  38. class Scene_Menu < Scene_MenuBase
  39.   #--------------------------------------------------------------------------
  40.   # ● 滑动前的准备
  41.   # 重定义开始时各个窗口的位置(基本会设置到屏幕外),
  42.   # 具体有哪些窗口去各个场景里面自己找。
  43.   #--------------------------------------------------------------------------
  44.   def init_slide
  45.     @command_window.y -= 150
  46.     @gold_window.x -= 100
  47.     @status_window.x = 260
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● 窗口滑动处理
  51.   #--------------------------------------------------------------------------
  52.   def slide_start
  53.     10.times do
  54.       @command_window.y += 15
  55.       @gold_window.x    += 10
  56.       @status_window.x  -= 10
  57.                       # 每帧移动的坐标量
  58.       Graphics.update # 刷新窗口
  59.     end
  60.     10.times{|i|
  61.     @gold_window.x    += 5 * Math.cos(i)
  62.     @command_window.y += 5 * Math.cos(i)
  63.     Graphics.update}  # 弹动
  64.   end
  65. end
  66. #==============================================================================
  67. #  物品画面
  68. #==============================================================================
  69. class Scene_Item < Scene_ItemBase
  70.   #--------------------------------------------------------------------------
  71.   # ● 滑动前的准备
  72.   #--------------------------------------------------------------------------
  73.   def init_slide
  74.     @category_window.x -= 100
  75.     @item_window.y += 100
  76.     @help_window.y -= 60
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● 窗口滑动处理
  80.   #--------------------------------------------------------------------------
  81.   def slide_start
  82.     10.times do
  83.       @category_window.x += 10
  84.       @item_window.y -= 10
  85.       @help_window.y += 6
  86.       # 每帧移动的坐标量
  87.       Graphics.update # 刷新窗口
  88.     end
  89.   end
  90. end
  91. #==============================================================================
  92. #  其他画面 泥萌自己写啦
  93. #==============================================================================

(https://rpg.blue/thread-375196-1-1.html
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
382
在线时间
41 小时
注册时间
2019-4-14
帖子
13
3
 楼主| 发表于 2021-3-23 18:12:09 | 只看该作者
alexncf125 发表于 2021-3-23 18:08
https://viparcher.github.io/Hexo/2012/12/23/%E7%AA%97%E5%8F%A3%E6%BB%91%E5%8A%A8%E7%BE%8E%E5%8C%96/
...

啊这,我是指游戏窗口滑动(
不过还是感谢分享
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
10
星屑
39475
在线时间
1916 小时
注册时间
2010-11-14
帖子
3319

R考场第七期纪念奖

4
发表于 2021-3-24 01:04:00 | 只看该作者

老实说,学会这个并不会让你的游戏怎么样……
还是多花点心思做好游戏本体吧。

RUBY 代码复制
  1. # 使用方法:
  2. # set_window(x, y)
  3. # 设置窗口位置到(x, y),从屏幕左上角开始计算
  4.  
  5. if !defined?(user32)
  6.   def user32(function, arg_types, return_value_type)
  7.     Win32API.new("user32.dll", function, arg_types, return_value_type)
  8.   end
  9. end
  10.  
  11. GetForegroundWindow = user32("GetForegroundWindow", "", "L")
  12. SetWindowPos = user32("SetWindowPos", ["L"] * 7, 'i')
  13.  
  14. $hwnd = GetForegroundWindow.call
  15.  
  16. def set_window(x, y)
  17.   SetWindowPos.call($hwnd, 0, x, y, Graphics.width, Graphics.height, 0)
  18. end


评分

参与人数 1+1 收起 理由
alexncf125 + 1 塞糖

查看全部评分

用头画头像,用脚写脚本
回复 支持 1 反对 0

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-20 21:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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