Window x coordinate not working.

● ARCHIVED · READ-ONLY
Started by Crystal Flareon 1 posts View original ↗
  1. I have created a plugin that revamps the Window_MenuActor to be smaller and fit the modifications I've been making to several plugins. While I was able to create the window and it works as desired, I am unable to alter its x coordinate. It seems permanently aligned to the right side of the screen and no matter what I do it simply can't be moved. The y coordinate works perfectly fine. I have put the plugin in a new project with no other plugins active and saw the same issue there, so it is isolated to my own plugin, yet I can't figure out what's anchoring it to the right side of the screen. In lieu of posting the entire project I am simply going to post my code since there's where the problem lies and it is rather short.

    Spoiler
    Code:
    //Chibi_MenuActor_Window
    
    function Window_MenuActor() {
    this.initialize.apply(this, arguments);
    }
    
    Window_MenuActor.prototype = Object.create(Window_MenuStatus.prototype);
    Window_MenuActor.prototype.constructor = Window_MenuActor;
    
    Window_MenuActor.prototype.initialize = function() {
    Window_MenuStatus.prototype.initialize.call(this, 0, 216);
    this.hide();
    };
    
    
    Window_MenuActor.prototype.numVisibleRows = function() {
    return 3;
    };
    
    Window_MenuActor.prototype.windowWidth = function() {
    return 408
    };
    
    Window_MenuActor.prototype.windowHeight = function() {
    return 300;
    };
    
    Window_MenuActor.prototype.drawItem = function(index) {
    this.drawItemBackground(index);
    this.drawItemStatus(index);
    };
    
    Window_MenuActor.prototype.drawItemStatus = function(index) {
    var actor = $gameParty.members()[index];
    var rect = this.itemRect(index);
    var x = rect.x;
    var y = rect.y;
    var width = rect.width - x - this.textPadding();
    this.drawActorCharacter(actor, rect.x + 28, rect.y + 65, Window_Base._faceWidth, Window_Base._faceHeight);
    this.drawActorHp(actor, x + 56, y, 300);
    this.drawActorMp(actor, x + 56, y + 32, 300);
    };
    
    Window_MenuActor.prototype.processOk = function() {
    if (!this.cursorAll()) {
    $gameParty.setTargetActor($gameParty.members()[this.index()]);
    }
    this.callOkHandler();
    };
    
    Window_MenuActor.prototype.selectLast = function() {
    this.select($gameParty.targetActor().index() || 0);
    };
    
    Window_MenuActor.prototype.selectForItem = function(item) {
    var actor = $gameParty.menuActor();
    var action = new Game_Action(actor);
    action.setItemObject(item);
    this.setCursorFixed(false);
    this.setCursorAll(false);
    if (action.isForUser()) {
    if (DataManager.isSkill(item)) {
    this.setCursorFixed(true);
    this.select(actor.index());
    } else {
    this.selectLast();
    }
    } else if (action.isForAll()) {
    this.setCursorAll(true);
    this.select(0);
    } else {
    this.selectLast();
    }
    };

    Spoiler
    jBWDVix.png