Status
Not open for further replies.

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,298
Reaction score
691
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,298
Reaction score
691
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
45,479
Reaction score
16,396
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 Posts

Latest Profile Posts

Someday, I hope they make a game where 95% of the animation budget went to turning valves and opening door animations, leaving every other animation looking like a CDI zelda cutscene.
programming at 12 years old: "I love how it works!"
programming at 18: "I love that it works."
programming at 25: "I love why it works."
programming at 30: "I love when it works."
programming at 50: "How did this work?"
Why can't I insert picture in this profile post? Only insert image -> by URL. No option to upload from my pc?
Trying out a new Battle Ui.
BattleUI.png
And.... I couldn't help myself. I linked my card game Lore and Concepts back to my RPG Maker game and made them take place in the same universe. I think that means I need to get back to work on my RPG Maker Game. There's obviously a story here my brain wants to tell.

Forum statistics

Threads
129,758
Messages
1,204,884
Members
170,846
Latest member
suball
Top