Project1

标题: 请问如何让镜头跟随事件移动 [打印本页]

作者: swdark123    时间: 2020-8-22 09:30
标题: 请问如何让镜头跟随事件移动
MZ的话 怎么设置游戏镜头跟着某一个事件移动呢 需要用到插件吗 还是只需要设置好事件就行 有没有大佬 最好能常常教我
作者: fux2    时间: 2020-8-23 06:52
通常情况下仅用事件有两个方法实现
1.移动事件的同时移动镜头
2.将主角图形变成该事件图形(或者透明),再移动,这是障眼法也比较好用

此外楼主提问最好把问题简要地写在标题上而不是XX何在,这样一来人家更能知道这个问题自己能不能答
二来便于以后的人搜索
作者: swdark123    时间: 2020-8-24 09:55
fux2 发表于 2020-8-23 06:52
通常情况下仅用事件有两个方法实现
1.移动事件的同时移动镜头
2.将主角图形变成该事件图形(或者透明),再 ...

好的 多谢fux2大佬
作者: godoway    时间: 2020-8-29 09:59
外网找到一个符合你要求的插件
https://forums.rpgmakerweb.com/index.php?threads/galvs-cam-control-mz.126314/

Features
This plugin adds a sliding motion to the normal camera motion when the player moves and also allows you to change the camera focus to:
– Player
– Event
– X,Y coordinates
Camera will slide to each target it changes to at speed specified in plugin call.
作者: swdark123    时间: 2020-9-10 20:13
godoway 发表于 2020-8-29 09:59
外网找到一个符合你要求的插件
https://forums.rpgmakerweb.com/index.php?threads/galvs-cam-control-mz.1 ...

谢谢大佬0 0这个我去看看
作者: xhjcz    时间: 2020-10-16 20:13
我觉得用主角,透明移动最简单

作者: 写给妖精的情诗    时间: 2026-3-31 01:20
本帖最后由 写给妖精的情诗 于 2026-3-31 09:55 编辑

Game_Player.prototype.center = function(x, y) {
    return $gameMap.setDisplayPos(x - this.centerX(), y - this.centerY());
};
虽然是几年前的帖子,但是我刚好也是搜索这个问题找过来的,就留个回复吧。
上面这段rmmz_objects.js的代码是玩家移动或者场所移动的时候,播放器始终以玩家为中心所以需要重新定位。
X和Y应该是玩家的坐标,centerX是下面这段代码,screenTileX这个东西是屏幕的宽度,
中心点centerX减去半个屏幕($gameMap.screenTileX() - 1) / 2;就是最左边显示的地方,因为上面这段是在左上角定位的。
Game_Player.prototype.centerX = function() {
    return ($gameMap.screenTileX() - 1) / 2;
};

//把左上角移到本事件的坐标,然后再减去半个屏幕的X轴和Y轴,就可以让本事件显示在屏幕中间了。
$gameMap.setDisplayPos($gameMap.event(this.eventId()).x - $gamePlayer.centerX(), $gameMap.event(this.eventId()).y - $gamePlayer.centerY());




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1