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,737
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

Drop shadows and water reflections tests in RPG Maker VX Ace


BgI3F80.png
I'm doing a fairy tale project Little Red Riding Hood and the Woodsman. I'm almost done with the demo in my native language and I intend to make a demo version in English as well. I'm just going to use the translator because I don't know the pronunciations very well, I only know how to say "Hey" and nothing else.. :kaoswt2:
SwordSkill wrote on TsukiAkari_Otome's profile.
You still interested in joining projects?
Maybe you could take a look at my project.

Forum statistics

Threads
118,613
Messages
1,117,317
Members
155,693
Latest member
azumiayumi
Top