RPG Maker MV 踩坑十一 精灵及背景绘制问题

RPG Maker MV战斗问题

在RMMV中战斗是在场景中调用战斗管理器,通过管理器去操作角色对象行动及精灵的绘制的。

入场飞身

在其中就发现一个问题加载图片进场时,会偏高,且显示的不是需要的那个需要绘制的区域。
在这里插入图片描述
从这可以看到人物进场时脚下的影子位置和飞身进场的位置差距挺大的且看到,不是我所理想的进场的姿势,那这发生了什么呢?
在这里插入图片描述
当时想到了是不是无意中调用了这里面的的偷窃的动画呢?
不过注释了 steal 后发现不是,那可能是什么问题呢?
在看到了控制台的打印后想到了是不是这个位置的出现了问题:

Sprite_Actor.prototype.refreshMotion = function() {
   
    var actor = this._actor;
    var motionGuard = Sprite_Actor.MOTIONS['guard'];
    if (actor) {
   
        if (this._motion === motionGuard && !BattleManager.isInputting()) {
   
                return;
        }
        var stateMotion = actor.stateMotionIndex();
        if (actor.isInputting() || actor.isActing()) {
   
            this.startMotion('wait');console.log("待机")
        } else if (stateMotion === 3) {
   
            this.startMotion('dead');
        } else if (stateMotion === 2) {
   
            this.startMotion('sleep');console.log("睡眠")
        } else if (actor.isChanting()) {
   
            this.startMotion('chant');console.log("魔法等待")
        } else if (actor.isGuard() || actor.isGuardWaiting()) {
   
            this.startMotion(&#
【实例教程1】怎样编写一个插件? 1. 插件的注释与定义参数 2. 读取插件参数 3. 插件指令的实现 【实例教程2】制作一个启动画面 1. 从哪里开始? 2. 创建启动画面的场景类 【实例教程3】玩转菜单初级篇 1. 给各个菜单界面添加背景 2.背景滚动起来 3. 在主菜单界面增加自定义菜单:改名 4. 在主菜单界面移除菜单命令 5. 在主菜单界面增加一个自定义窗口 【实例教程4】玩转标题画面 1. 美化游戏标题 2.背景动起来 3. 自定义标题菜单 4. 美化菜单 【实例教程5】制作小游戏:坦克大战(上) 1. 游戏结构及流程介绍 2. 相关素材资源的下载和使用 3. 基础知识:音效的播放 4. 基础知识:精灵表的切帧 5. 基础知识:使用MV中的动画 6. Scene_TankWarTitle类解析 7. Sprite_Bullet类解析 8. Sprite_Explode类解析 9. Sprite_Tank类解析 10. Sprite_Enemy类解析 11. Scene_TankWar类解析 12. Scene_TankWarGameOver类解析 【实例教程6】存档的加密解密与保护 1. 找出MV存档和读档的方式 2. 制作MV存档的修改器 3. 如何保护存档? 4. 制作一个存档保护插件 【实例教程7】制作一个传送插件 1. 传送插件的主要功能 2. 将自定义数据保存到存档中 3. meta数据的使用 4. 使用地图备注登记传送点 5. 在插件中解析并记录传送点 6. 使用地图备注登记多个传送点并在插件中记录 7. 制作传送点选取窗口显示传送点数据 8. 将物品或技能标记为传送物品、传送技能 9. 显示传送动画实现传送功能 10. 禁止使用传送道具或传送技能 11. 实现插件命令
### RPG Maker MV SV Battle Sprites Position Settings In RPG Maker MV, the positioning of SV (Side-View) battle sprites is managed through specific properties and methods within the sprite objects. The `Sprite_Battler` class handles these operations for battlers in battles[^1]. For SV battle sprites specifically: The position setting involves adjusting the coordinates (`x`, `y`) as well as depth or layering via the `z` property on instances derived from `Sprite`. These adjustments can be made directly by modifying these attributes programmatically when customizing behavior beyond default implementations provided out-of-the-box with RPG Maker MV. For precise control over where an SV battle character appears relative to other elements like backgrounds or UI components during combat sequences, developers often override or extend existing functions related to drawing and updating positions of such sprites. This includes manipulating transformation matrices applied before rendering each frame which allows more complex transformations than simple translation alone could offer. Additionally, understanding how RM's core scripts manage this process helps immensely; particularly reviewing sections dealing explicitly with side-view battles inside files such as rpg_sprites.js offers valuable insights into best practices for altering placement without causing conflicts elsewhere in game logic[^2]. ```javascript // Example method to adjust a Sprite_Battler instance’s position. const originalUpdatePosition = Sprite_Battler.prototype.updatePosition; Sprite_Battler.prototype.updatePosition = function() { // Custom modifications here... const offsetX = 0; // Adjust X offset accordingly const offsetY = 0; // Adjust Y offset accordingly this.x += offsetX; this.y += offsetY; // Call parent implementation after making changes originalUpdatePosition.call(this); }; ``` --related questions-- 1. How does one customize animations associated with SV battle sprites? 2. What are some common pitfalls encountered while repositioning sprites dynamically at runtime? 3. Can you explain the role of prototype chains concerning sprite classes in RPG Maker MV? 4. Is there any impact on performance due to frequent updates to sprite positions?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值