Comments (3)
how we supose to deal with somthing like thats .
I do not want documentation comparable to Unity with here super doc on C#
but these difficult to understand what happens here OMG!
var PIXI;
(function (PIXI) {
var tilemap;
(function (tilemap_1) {
var ZLayer = (function (_super) {
__extends(ZLayer, _super);
function ZLayer(tilemap, zIndex) {
var _this = _super.call(this) || this;
_this._lastAnimationFrame = -1;
_this.tilemap = tilemap;
_this.z = zIndex;
return _this;
}
ZLayer.prototype.clear = function () {
var layers = this.children;
for (var i = 0; i < layers.length; i++)
layers[i].clear();
this._previousLayers = 0;
};
ZLayer.prototype.cacheIfDirty = function () {
var tilemap = this.tilemap;
var layers = this.children;
var modified = this._previousLayers != layers.length;
this._previousLayers = layers.length;
var buf = this.canvasBuffer;
var tempRender = this._tempRender;
if (!buf) {
buf = this.canvasBuffer = document.createElement('canvas');
tempRender = this._tempRender = new PIXI.CanvasRenderer(100, 100, { view: buf });
tempRender.context = tempRender.rootContext;
tempRender.plugins.tilemap.dontUseTransform = true;
}
if (buf.width != tilemap._layerWidth ||
buf.height != tilemap._layerHeight) {
buf.width = tilemap._layerWidth;
buf.height = tilemap._layerHeight;
modified = true;
}
var i;
if (!modified) {
for (i = 0; i < layers.length; i++) {
if (layers[i].isModified(this._lastAnimationFrame != tilemap.animationFrame)) {
modified = true;
break;
}
}
}
this._lastAnimationFrame = tilemap.animationFrame;
if (modified) {
if (tilemap._hackRenderer) {
tilemap._hackRenderer(tempRender);
}
tempRender.context.clearRect(0, 0, buf.width, buf.height);
for (i = 0; i < layers.length; i++) {
layers[i].clearModify();
layers[i].renderCanvas(tempRender);
}
}
this.layerTransform = this.worldTransform;
for (i = 0; i < layers.length; i++) {
this.layerTransform = layers[i].worldTransform;
break;
}
};
;
ZLayer.prototype.renderCanvas = function (renderer) {
this.cacheIfDirty();
var wt = this.layerTransform;
renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution, wt.ty * renderer.resolution);
var tilemap = this.tilemap;
renderer.context.drawImage(this.canvasBuffer, 0, 0);
};
;
console.log('zzzzzzzzzzzzzzzzzzzzzzzzzzzZLayer: ', ZLayer);
return ZLayer;
}(PIXI.Container));
tilemap_1.ZLayer = ZLayer;
})(tilemap = PIXI.tilemap || (PIXI.tilemap = {}));
})(PIXI || (PIXI = {}));
from corescript.
ok am not shure at 100% but what do you think about
ShaderTilemap.prototype._paintAllTiles = function(startX, startY) {
is the good class to call function and add some children in the ZLayer ?
from corescript.
ok close #127
it solved.
I hate this ShaderTilemap. 4 hours on and I think I have a solution. Why rmmv, do not do as UNITY and comment all codes.!!!!!!
pixiSSA._rmmvAlias.ShaderTilemap_paintAllTiles = ShaderTilemap.prototype._paintAllTiles;
ShaderTilemap.prototype._paintAllTiles = function(startX, startY) {
pixiSSA._rmmvAlias.ShaderTilemap_paintAllTiles.call(this,startX, startY);
// start add layer aniPictures
this.addPictureAniLayers(pixiSSA._animationControler._pictures);
}
//TODO: faire un scan de tous les layer possible, et ajouter de haut en bas. Le scan peut etre fait au debut dans le plugin parameter
ShaderTilemap.prototype.addPictureAniLayers = function(aniLayersContainers) {
console.log(this,'32áaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa32'); // wow work register Zindex
//create all layer, but need check if we assign special rmmv layer
for(layer in aniLayersContainers){
console.log('layer: ', layer);
if( aniLayersContainers[layer]._asignedRmmvLayer ){ // if assigned rmmv zLayer
var layerGameName = aniLayersContainers[layer]._asignedLayerGame;
if(layerGameName==='belowEvents'){ // couche sous Event dans lowerZLayer
console.log('belowEvents: +++++++++++++++++++++');
this.lowerZLayer.addChild(aniLayersContainers[layer]); // why i can no add all child to 0
}
}else{ // default Top Picture ZLayer TODO:
//this.addChild(aniLayersContainers[layer]);
}
}
};
from corescript.
Related Issues (20)
- Auto Save System HOT 1
- Unable to preventDefault inside passive event listener due to target being treated as passive. HOT 1
- Performance reduction of Save / Load Scene when there are many save data
- Bitmap._requestImage discards _reuseImages & dropped Image object HOT 2
- Request to be added to RPV Maker MV CoreScript Slack HOT 2
- Refine the bug report and error message when error occurred HOT 1
- clean project ! HOT 1
- Error in master HOT 4
- Appropriateness on accessing `$gameSystem` from `Scene_Base` HOT 3
- BattleTest and EventTest can't start HOT 2
- BGM restarts every several seconds in Chrome HOT 1
- Progress bar is shown to a wrong position.
- Map and Battle scenes drawing delay of official corescript ver1.6.1 HOT 1
- "$this." or "$self." self reference for events. The current way is very counter intuitive even for programmers HOT 8
- plugin problem
- [CRITICAL] core script makes lots of cache textures HOT 5
- _hasError of WebAudio object is never set false
- Why not es6 class? HOT 4
- StorageManager has a name conflict with WebAPI's StorageManager
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corescript.