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 Posts

Latest Profile Posts

The last two months of 2020 were bitter for me. It was a hard year.

January came and there wasn't so much to celebrate.

Nonetheless we must keep pushing.

I know I'm late, but I'm here to wish you all a good, safe and prosperous 2021.
Sooo I tried CSP Ex today.

One word. "Passionate" or maybe "emotional", either way, such states determines the heat on this hot headed fire ball. Destructive and powerful, this monster might not be a good first choice for a newbie taming monsters.

This hyper-energetic monster hops and runs around; full of life, or should I say full of water? Also known as the "Water Balloon" monster he can set out a quick jet stream of water capable of piercing through the toughest of armor.

This ball of mud has quite the lazy attitude towards it's tamer. While it may be weak on offense attacks, it excels greatly on defense and support abilities.

Forum statistics

Threads
107,363
Messages
1,029,130
Members
139,456
Latest member
ivanbuuren
Top