Status
Not open for further replies.

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,101
Reaction score
568
First Language
German
Primarily Uses
RMMV
hi^^ , i was able to draw a not moving singel walking char img into a custom window..

But this had the usual loading issue (not displayed at first)..
and i would preffer the animated version anyway..
(because update/refresh functions will be needed anyway to solve the "loading issue")

can anybody show me how to do this?
 
Last edited:

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,101
Reaction score
568
First Language
German
Primarily Uses
RMMV
i figured it out^^
Screenshot_1.png
I forgot to mention, this "custom window" is used in the menu, if you wanna use this solution outside of the menu,..
.. you will need to change the "this._actor"-data

JavaScript:
this._actor = $gameParty.menuActor();
// if not using this custom window in the menu, pls change the actor data


i will add my code solution into the Spoiler,
but pls Note the Char size is *2
that is made here:
(and can be changed here)
JavaScript:
      var dw = 2 * pw;
      var sh = 2 * ph;
// this makes the charsize *2
// can be changed easyly by using other numbers
// or edit the code to not use "dw" & "sh"

Custom Window Code :
JavaScript:
function Window_Custom() {
    this.initialize.apply(this, arguments);
}

Window_Custom.prototype = Object.create(Window_Base.prototype);
Window_Custom.prototype.constructor = Window_Custom;

Window_Custom.prototype.initialize = function(x, y, width) {
      this._actor = $gameParty.menuActor();
      var width = this.windowWidth();
      var height = this.windowHeight();
      var x = 145;
      var y = 195;
      this._x = x;
      this._y = y;
      this._updateCounter = 0;
      this._step = 0;
      this._characterName = this._actor.characterName;
      this._characterIndex = this._actor.characterIndex;
      Window_Base.prototype.initialize.call(this, x, y, width, height);
      this.drawActorCharacter(this._actor, x - 112, y - 140);
};

Window_Custom.prototype.update = function() {
      this._updateCounter += 1;
      if (this._updateCounter >= 25) {
          this._step += 1;
          if (this._step === 3) {this._step = -1};
          this.refresh();
          this._updateCounter = 0;
      }
};

Window_Custom.prototype.refresh = function() {
      if (this.contents) {
          this.contents.clear();
          this.drawActorCharacter(this._actor, this._x - 112, this._y - 140);
      }
};

Window_Custom.prototype.windowWidth = function() {
      return 150;
};

Window_Custom.prototype.windowHeight = function() {
      return 155;
};

Window_Custom.prototype.drawActorCharacter = function(actor, x, y) {
      if (this._step === 2) {var step = 0} else {var step = this._step};
      this.drawStepCharacter(actor.characterName(), actor.characterIndex(), x, y, step);
};
 
Window_Custom.prototype.drawStepCharacter = function(characterName, characterIndex, x, y, step) {
      var bitmap = ImageManager.loadCharacter(characterName);
      var big = ImageManager.isBigCharacter(characterName);
      var pw = bitmap.width / (big ? 3 : 12);
      var ph = bitmap.height / (big ? 4 : 8);
      var n = characterIndex;
      var sx = (step * 48) + ((n % 4 * 3 + 1) * pw);
      var sy = (Math.floor(n / 4) * 4) * ph;
      var dw = 2 * pw;
      var sh = 2 * ph;
      this.contents.blt(bitmap, sx, sy, pw, ph, x - pw / 2, y - ph, dw, sh);
};
also the custom Window is very small, xy & width and height,.. should be changed to whatever is needed in own projects

//this will be reported as solved and can be closed .thx

Incase you are looking for the "SV Battler Img" in a window, you can use this solution instead:
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,740
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.



Thanks for adding the solution. Next time, could you please edit your post and add it in, to avoid double posting? thanks :)


Edit: reopened

Edit: reclosed
 
Last edited:
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

I think it's by time I make use of this feature in the forums. I'm never one to share profile updates or anything the sort, but hey, you gotta start somewhere! I think I'll use this place primarily to post maps actually, so here, have a goblin cave!

PqleoRp.png

Inspired largely by Wynncraft's Aseado Leaf cave
Does anyone know if Yanfly's Ace scripts are still free for use in both commercial and noncommercial projects? Can't find much except for the wordpress Terms of Use, but not sure if it's not outdated.
I just realized two of My series are beginning to look virtually identical to one another in mechanics and general themes, I never had this problem before.

This is Stifling! Must resolve this!
Lord's Reincarnation III (LR3) MOBILE is coming!!!
iu_534706_7630675.png
ScreenShot_1_20_2022_2_19_41.png
Juice FX is amazing... the portal in the middle is actually animated and moves thanks to Juice FX. so I edited part of a map I have and then drew the portal around it. threw it into Juice FX and now it's lively instead of static.

Forum statistics

Threads
118,711
Messages
1,118,095
Members
155,847
Latest member
pol2ww3
Top