SRD's Camera Core margins forbids a rectangle draw

Feelzor

Veteran
Veteran
Joined
Oct 10, 2017
Messages
92
Reaction score
81
First Language
French
Primarily Uses
RMMV
Hello !

I have a problem with SRD's Camera Core plugin.
If the zoom is set between 0 and 1 (so it unzooms the game), it creates a margin all around my plugin's (LNM Lighting and Time editor) rectangle. If I increase the size of the rectangle, it will fill the right and bottom, but not the left and top. To avoid that problem, I tried to move the Sprite with negative coordinates, but even if it is supposed to fill it, it will leave an empty space (as shown on the image, I moved my sprite a lot to the top left, as you can see).

So I wondered if anyone could help me find a way to solve that? It would be highly appreciated, as it's now been months I started thinking about how to solve that problem.

Here's my code, FYI:

Code:
//-----------------------------------------------------------------------------
// Spriteset_Map
//
// The set of sprites on the map screen.

Spriteset_Map.prototype.createLowerLayer = function() {
    Spriteset_Base.prototype.createLowerLayer.call(this);
    this.createParallax();
    this.createTilemap();
    this.createCharacters();
    this.createShadow();
    this.createDestination();
    this.createLighting();
    this.createWeather();
};

Spriteset_Map.prototype.update = function() {
    Spriteset_Base.prototype.update.call(this);
    this.updateTileset();
    this.updateParallax();
    this.updateTilemap();
    this.updateShadow();
    this.updateLighting();
    this.updateWeather();
};

Spriteset_Map.prototype.createLighting = function() {
    $gameLighting.clear();
    this._lightingTexture = PIXI.RenderTexture.create(Graphics.width, Graphics.height);
    this._lightingSurface = new LightingSurface();
    this._lightingSprite = new PIXI.Sprite();
    this._lightingSprite.texture = this._lightingTexture;
    this._lightingSprite.blendMode = PIXI.BLEND_MODES.MULTIPLY;
    this._lightingSprite.alpha = 1.0;
    this.addChild(this._lightingSprite);
};

Spriteset_Map.prototype.updateLighting = function() {
    this._lightingSurface.update();
    Graphics._renderer.render(this._lightingSurface, this._lightingTexture, false);
};

//-----------------------------------------------------------------------------
// LightingSurface
//
//

function LightingSurface() {
    this.initialize.apply(this, arguments);
}

LightingSurface.prototype = Object.create(PIXI.Container.prototype);
LightingSurface.prototype.constructor = LightingSurface;

LightingSurface.prototype.initialize = function() {
    PIXI.Container.call(this);
    this._width = Graphics.width;
    this._height = Graphics.height;
    this._createSurface();
};

LightingSurface.prototype._createSurface = function() {
    this._surface = new Sprite();
    this._surface.bitmap = new Bitmap(this._width, this._height);
    var color = GameEditor.rgbToHex($gameTime.tint(0), $gameTime.tint(1), $gameTime.tint(2));
    this._lastColor = color;
    this._surface.bitmap.fillRect(0, 0, this._width, this._height, color);
    this.addChild(this._surface);
};


LightingSurface.prototype.update = function() {   
    var color = GameEditor.rgbToHex($gameTime.tint(0), $gameTime.tint(1), $gameTime.tint(2));
    if (this._lastColor !== color) {
        this._surface.bitmap.fillRect(0, 0, this._width, this._height, color);
        this._lastColor = color;
    }

    this.children.forEach(function(child) {
        if (child.update) {
            child.update();
        }
    });
};
The plugin can be downloaded here.

I hope someone can help me find out how to solve that problem that starts to become a bit boring :(
Have a good day / evening / night :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

I'm stuck, I'm making some of Mr. N's Dialogue but I can't finish his full Dialogue...heres what I got now [this is the part I'm stuck on] "You treat me like a
bug, I'M SICK OF IT, you had me make these...abominations...well, now..." and at the "Well, now...' part I'm stuck at, anyone got Ideas?
Ami
--- Top Up ---

Merchant: Diamond Sword cost 100 Diamonds
F.Magic Knight
: I don't have Diamonds,what should we do?
M.Knight: I don't have any choice,i have to Buy Diamonds with my Card
F.Magic Knight
: You do?
(M.Knight's Balance Just Have 1.25)
M.Knight: (Chuckle) Maybe,later…
Decided to add the option to customize decor/furniture in the player's base -- a couple of item options per furniture slot, some different carpets, etc. It's not really difficult to event, but oh goodness it's much more tedious to implement than I anticipated :'D
Dunno but maybe I'll make an art raffle soon. Anyone interested in it?

Forum statistics

Threads
107,532
Messages
1,030,324
Members
139,662
Latest member
Wilcom
Top