Status
Not open for further replies.

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,099
Reaction score
565
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,099
Reaction score
565
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,645
Reaction score
15,728
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

SF_Vehicle2 and SF_People2_8 added!
index.php

If I made an 8-bit-esque, dark fantasy tileset/graphics pack, would y'all be into that? Like, for Dark Souls demakes, Nintendo vampire wannabes, Castlevania ripoffs and such?

Working title: Alice's 8-bit Gothic. Do or not do? (Like do y'all even use 8-bit style graphics?)
I love editing things .
16b6a8abb5d27bf617d9b802cd5b868a.jpg

* Wall frames made with pencil photo and program photos, * Leaf and Pot, with cliché ideas of flowers
*bear on top of the closet belonging to the art of whtdragon lol.
No better feeling than part of a project just clicking into place without a single issue.

Forum statistics

Threads
118,438
Messages
1,115,991
Members
155,402
Latest member
Bansher
Top