Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // Archeia RPG Core Patch
- // Version: 1.0
- //=============================================================================
- //-----------------------------------------------------------------------------
- // * Make sure that the game always scale properly.
- //-----------------------------------------------------------------------------
- Graphics._updateRealScale = function() {
- if (this._stretchEnabled) {
- var h = window.innerWidth / this._width;
- var v = window.innerHeight / this._height;
- this._realScale = Math.min(h,v);
- if (this._realScale>=3) this._realScale = 3;
- else if (this._realScale>=2) this._realScale = 2;
- else if (this._realScale>=1.5) this._realScale = 1.5;
- else if (this._realScale>=1) this._realScale = 1;
- else this._realScale = 0.5;
- } else {
- this._realScale = this._scale;
- }
- };
- //-----------------------------------------------------------------------------
- // * Remove smoothing from graphics
- //-----------------------------------------------------------------------------
- Graphics._centerElement = function(element) {
- var width = element.width * this._realScale;
- var height = element.height * this._realScale;
- element.style.position = 'absolute';
- element.style.margin = 'auto';
- element.style.top = 0;
- element.style.left = 0;
- element.style.right = 0;
- element.style.bottom = 0;
- element.style.width = width + 'px';
- element.style.height = height + 'px';
- element.style["image-rendering"] = "pixelated";
- element.style["font-smooth"] = "none";
- };
- //-----------------------------------------------------------------------------
- // * Make Cursor Tile instead of stretching
- // Use it with this plugin for maximum effect: http://sumrndm.site/window-frame-anti-stretch/
- //-----------------------------------------------------------------------------
- Window.prototype._refreshCursor = function() {
- var pad = this._padding;
- var x = this._cursorRect.x + pad - this.origin.x;
- var y = this._cursorRect.y + pad - this.origin.y;
- var w = this._cursorRect.width;
- var h = this._cursorRect.height;
- var m = 4;
- var x2 = Math.max(x, pad);
- var y2 = Math.max(y, pad);
- var ox = x - x2;
- var oy = y - y2;
- var w2 = Math.min(w, this._width - pad - x2);
- var h2 = Math.min(h, this._height - pad - y2);
- var bitmap = new Bitmap(w2, h2);
- this._windowCursorSprite.bitmap = bitmap;
- this._windowCursorSprite.setFrame(0, 0, w2, h2);
- this._windowCursorSprite.move(x2, y2);
- // Spacing 1
- var sp1 = 10;
- if (w > 0 && h > 0 && this._windowskin) {
- var skin = this._windowskin;
- var p = 96;
- var q = 48;
- bitmap.blt(skin, p, p, sp1, sp1, ox, oy);
- bitmap.blt(skin, p + q - sp1, p, sp1, sp1, ox + w2 - sp1, oy);
- bitmap.blt(skin, p, p + q - sp1, sp1, sp1, ox, oy + h2 - sp1);
- bitmap.blt(skin, p + q - sp1, p + q - sp1, sp1, sp1, ox + w2 - sp1, oy + h2 - sp1);
- bitmap.blt(skin, p + sp1, p, q - (sp1 * 2), sp1, ox + sp1, oy, w2 - (sp1 * 2))
- bitmap.blt(skin, p + sp1, p + q - sp1, q - (sp1 * 2), sp1, ox + sp1, oy + h2 - sp1, w2 - (sp1 * 2))
- bitmap.blt(skin, p, p + sp1, sp1, q - (sp1 * 2), ox, oy + sp1, sp1, h2 - (sp1 * 2))
- bitmap.blt(skin, p + q - sp1, p + sp1, sp1, q - (sp1 * 2), ox + w2 - sp1, oy + sp1, sp1, h2 - (sp1 * 2))
- bitmap.blt(skin, p + sp1, p + sp1, q - (sp1 * 2), q - (sp1 * 2), ox + sp1, oy + sp1, w2 - (sp1 * 2), h2 - (sp1 * 2))
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement