Adjusting X/Y Position

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,195
First Language
English
Primarily Uses
RMMV
So I'm trying to move the sprite in the window on the bottom left on the screen. However, I can't find anything in the code that manages this. Here's a screenshot: (sprite has those white squares so I can easily tell where the edges are)
1595050531072.png

I'm basically trying to move it down so that it's below the character's name, which in this case is "Male" (for testing lol). This is the relevant function(s):
JavaScript:
Window_TBSStatus.prototype.refresh = function () {
    this.contents.clear();
    this._gaugeHeight = null;
    this.resetFontSettings();
    if (!this._entity) return;
    var x, y, w, h;
    y += 20;
    //- Face
    this.drawSprite();
    //- Name
    x = Lecode.S_TBS.Windows.statusWindowSpriteBoxW;
    y = -4;
    this.contents.fontSize += 3;
    this.changeTextColor(this.systemColor());
    this.leU_drawText(this._entity.battler().name(), 0, y);
    this.contents.fontSize -= 6;
    //- HP Gauge
    y += this.lineHeight() - 8;
    this.drawActorHp(this._entity.battler(), x, y + 3, 160);
    //- MP Gauge
    y += this.lineHeight() - 8;
    this.drawActorMp(this._entity.battler(), x, y + 3, 160);
    //- TP Gauge
    if (Lecode.S_TBS.Windows.statusWindowShowTP) {
    y += this.lineHeight() - 8;
        this.drawActorTp(this._entity.battler(), x, y + 3, 160);
    }
    //- Move Points
    if (Lecode.S_TBS.Windows.statusWindowShowMovePoints) {
        y += this.lineHeight() + 4;
        var mp = this._entity.getMovePoints();
        var gw = (130 - mp * 4) / mp; //14
        x++;
        for (var i = 0; i < mp; i++) {
            this.contents.fillRect(x, y, gw, 2, this.textColor(Lecode.S_TBS.Windows.movePointsColor));
            x += gw + 4;
        }
    }
    // - States
    x = 96;
    y -= this.lineHeight();
    var max = Lecode.S_TBS.Windows.statusWindowMaxStates;
    this.drawActorIcons(this._entity.battler(), x, y - 46, Window_Base._iconWidth * 5);
};

Window_TBSStatus.prototype.drawSprite = function () {
    var bitmap = ImageManager.loadLeTBSStatus(this._entity.filenameID());
    var window = this;
    bitmap.addLoadListener(function () {
        var dx = eval(Lecode.S_TBS.Windows.statusWindowSpriteBoxW) / 2 - bitmap.width / 2;
        var dy = 20 + eval(Lecode.S_TBS.Windows.statusWindowSpriteBoxH) / 2 - bitmap.height / 2;
        this.contents.blt(bitmap, 0, 0, bitmap.width, bitmap.height, dx, dy);
    }.bind(this));
};
this.drawSprite(); is what's drawing the image I'm trying to adjust. It leads to a function which is towards the end of the code above. I've tried editing the values for dy, but it had no effect. I've also tried adding y = 40; which also didn't work... I'm stumped at this point, sigh.
 

Waifus69

Veteran
Veteran
Joined
Jun 30, 2020
Messages
42
Reaction score
21
First Language
English
Primarily Uses
RMMV
So I'm trying to move the sprite in the window on the bottom left on the screen. However, I can't find anything in the code that manages this. Here's a screenshot: (sprite has those white squares so I can easily tell where the edges are)
View attachment 151729

I'm basically trying to move it down so that it's below the character's name, which in this case is "Male" (for testing lol). This is the relevant function(s):
JavaScript:
Window_TBSStatus.prototype.refresh = function () {
    this.contents.clear();
    this._gaugeHeight = null;
    this.resetFontSettings();
    if (!this._entity) return;
    var x, y, w, h;
    y += 20;
    //- Face
    this.drawSprite();
    //- Name
    x = Lecode.S_TBS.Windows.statusWindowSpriteBoxW;
    y = -4;
    this.contents.fontSize += 3;
    this.changeTextColor(this.systemColor());
    this.leU_drawText(this._entity.battler().name(), 0, y);
    this.contents.fontSize -= 6;
    //- HP Gauge
    y += this.lineHeight() - 8;
    this.drawActorHp(this._entity.battler(), x, y + 3, 160);
    //- MP Gauge
    y += this.lineHeight() - 8;
    this.drawActorMp(this._entity.battler(), x, y + 3, 160);
    //- TP Gauge
    if (Lecode.S_TBS.Windows.statusWindowShowTP) {
    y += this.lineHeight() - 8;
        this.drawActorTp(this._entity.battler(), x, y + 3, 160);
    }
    //- Move Points
    if (Lecode.S_TBS.Windows.statusWindowShowMovePoints) {
        y += this.lineHeight() + 4;
        var mp = this._entity.getMovePoints();
        var gw = (130 - mp * 4) / mp; //14
        x++;
        for (var i = 0; i < mp; i++) {
            this.contents.fillRect(x, y, gw, 2, this.textColor(Lecode.S_TBS.Windows.movePointsColor));
            x += gw + 4;
        }
    }
    // - States
    x = 96;
    y -= this.lineHeight();
    var max = Lecode.S_TBS.Windows.statusWindowMaxStates;
    this.drawActorIcons(this._entity.battler(), x, y - 46, Window_Base._iconWidth * 5);
};

Window_TBSStatus.prototype.drawSprite = function () {
    var bitmap = ImageManager.loadLeTBSStatus(this._entity.filenameID());
    var window = this;
    bitmap.addLoadListener(function () {
        var dx = eval(Lecode.S_TBS.Windows.statusWindowSpriteBoxW) / 2 - bitmap.width / 2;
        var dy = 20 + eval(Lecode.S_TBS.Windows.statusWindowSpriteBoxH) / 2 - bitmap.height / 2;
        this.contents.blt(bitmap, 0, 0, bitmap.width, bitmap.height, dx, dy);
    }.bind(this));
};
this.drawSprite(); is what's drawing the image I'm trying to adjust. It leads to a function which is towards the end of the code above. I've tried editing the values for dy, but it had no effect. I've also tried adding y = 40; which also didn't work... I'm stumped at this point, sigh.
Maybe try y +=40 or y = +40, something like that.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,709
Reaction score
1,127
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi!
I don't know, maybe it is here?
X Y
this.contents.blt(bitmap, 0, 0, bitmap.width, bitmap.height, dx, dy);
In the function Window_TBSStatus.prototype.drawSprite
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,195
First Language
English
Primarily Uses
RMMV
Maybe try y +=40 or y = +40, something like that.
Hi!
I don't know, maybe it is here?
X Y
this.contents.blt(bitmap, 0, 0, bitmap.width, bitmap.height, dx, dy);
In the function Window_TBSStatus.prototype.drawSprite
Already tried both of those, to no avail...:kaoeh:

Edit: The y += 20; just before the line //- Face wasn't there by default. I added it in hopes of moving the image down, but it had no effect...

I've tried changing the "0" (the numbers you have in bold) but also had no effect...
 
Last edited:

Ace of Spades

Veteran
Veteran
Joined
Jan 19, 2017
Messages
138
Reaction score
202
First Language
English
Primarily Uses
Code:
this.drawSprite();
is referring to
Code:
Window_TBSStatus.prototype.drawSprite = function () {
    var bitmap = ImageManager.loadLeTBSStatus(this._entity.filenameID());
    var window = this;
    bitmap.addLoadListener(function () {
        var dx = eval(Lecode.S_TBS.Windows.statusWindowSpriteBoxW) / 2 - bitmap.width / 2;
        var dy = 20 + eval(Lecode.S_TBS.Windows.statusWindowSpriteBoxH) / 2 - bitmap.height / 2;
        this.contents.blt(bitmap, 0, 0, bitmap.width, bitmap.height, dx, dy);
    }.bind(this));
So you'll have to edit var dy... try changing the 20 to a 40 in here to see if that works.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,195
First Language
English
Primarily Uses
RMMV
Code:
this.drawSprite();
is referring to
Code:
Window_TBSStatus.prototype.drawSprite = function () {
    var bitmap = ImageManager.loadLeTBSStatus(this._entity.filenameID());
    var window = this;
    bitmap.addLoadListener(function () {
        var dx = eval(Lecode.S_TBS.Windows.statusWindowSpriteBoxW) / 2 - bitmap.width / 2;
        var dy = 20 + eval(Lecode.S_TBS.Windows.statusWindowSpriteBoxH) / 2 - bitmap.height / 2;
        this.contents.blt(bitmap, 0, 0, bitmap.width, bitmap.height, dx, dy);
    }.bind(this));
So you'll have to edit var dy... try changing the 20 to a 40 in here to see if that works.
Yep, I tried that...no effect, unfortunately. I've pretty much tried changing anything that's in numerical form lol.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top