Replace window background for a image piece

Discussion in 'Javascript/Plugin Support' started by King Gerar, Nov 10, 2015.

  1. King Gerar

    King Gerar Sword of the Morning Veteran

    Messages:
    163
    Likes Received:
    204
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    My regards, bipeds!
     

    I wonder if it's possible to modify the "construction" of the windows. Instead of using

    the background contained in windowskin graphic, use a piece (rect) of an other image.

    However, it would still use the edges of windowskin.

    I made an example to show. The image on spoiler is full image background, where

    I would take the "pieces" to use as background.

    [​IMG]

     

    [​IMG]

     

    Then, it's possible? Thank you in advance.
     
    #1
  2. Ramiro

    Ramiro Now with an army of Mecha-Ralphs! Veteran

    Messages:
    860
    Likes Received:
    366
    Location:
    Argentina
    First Language:
    Spanish
    Yes, there is, by default MV does this:

    /** * @method _refreshBack * @private */Window.prototype._refreshBack = function() { var m = this._margin; var w = this._width - m * 2; var h = this._height - m * 2; var bitmap = new Bitmap(w, h); this._windowBackSprite.bitmap = bitmap; this._windowBackSprite.setFrame(0, 0, w, h); this._windowBackSprite.move(m, m); if (w > 0 && h > 0 && this._windowskin) { var p = 96; bitmap.blt(this._windowskin, 0, 0, p, p, 0, 0, w, h); for (var y = 0; y < h; y += p) { for (var x = 0; x < w; x += p) { bitmap.blt(this._windowskin, 0, p, p, p, x, y, p, p); } } var tone = this._colorTone; bitmap.adjustTone(tone[0], tone[1], tone[2]); }};replacing it with a custom blt from another image is then possible.

    Remember than that image has to be previously loaded.
     
    Last edited by a moderator: Nov 10, 2015
    #2
  3. King Gerar

    King Gerar Sword of the Morning Veteran

    Messages:
    163
    Likes Received:
    204
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Hum... on one hand I'm happy to know that it's possible, but for other...

    I don't know how to do it. Everything I tried returned in error, or does no effect.

    It's possible to show me specifically where I change? I'm not very experienced in this...  :(
     
    #3

Share This Page