audo

Villager
Member
Joined
Oct 2, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
N/A
I am working with some experimental large resolution tile sets that have stupidly huge tiles. They look cool but I need to be able to easily zoom in and out for it to work in a game. I got zoom working with a mouse wheel but not when combined with YED_TileD.

TileD is perfect but it has a conflict with both SRD_CameraCore.js and MBS_MapZoom.js. I modified both to let me permanently zoom in and out with the mouse wheel, while trying to get this to work. Both conflict with rectLayer.addRect(textureId, ux, uy, dx, dy, w, h); Which is where the individual tiles are added to the individual layers.

SRD_CameraCore.js crashes with an error mesege. Cannot read property addrect of undefined. If I comment out the line that actually lets it resize the map then zooming still works on the character, but the background is black. However it did trigger some logging that I added in that seems to indicate it loading new tiles as it should when you zoom out. It was just not drawing them because I had removed that.

MBS_MapZoom.js is slightly less in conflict because it loads the TileD map and lets you zoom in and out, but not further out than is at the start. I think the error here is because of needing to load more tiles that were off screen. It scrolls out to about .99 zoom, but going further breaks it. Where numbers lower than 1.0 are zoom out.

I have tried changing a lot of the values in YED_TileD but have not found anything that I could just multiply by some scale value and get the output I want.

Layers are created by _createLayers
var layer = new PIXI.tilemap.CompositeRectTileLayer(zIndex, [], useSquareShader);
layer.layerId = id; // @dryami: hack layer index
layer.spriteId = Sprite._counter++;
this._layers.push(layer);
this.addChild(layer);

Layer is passed from method to method but and is first used by
_paintAllTiles which seems to send each layer one at a time to the next method
_paintTiles, which seems to just do a small check to see if the layer is maked as visible.
_paintTilesLayer which seems to figure out what tiles are currently needed to be drawn on the screen. It takes the layer and, where the tile is in the tile sheet, and where it needs to be in the layer to be painted and it sends that to...
_paintTile which actually paints the tile, one at a time to a layer. Messing with numbers here can cause tiles to be spaced incorrectly but the tiles themselves do not change in size.
rectLayer.addRect(textureId, ux, uy, dx, dy, w, h); is the line where it actually gets drawn, and this conflicts with other zooming plugins.

I hope someone has some incite as to what I am supposed to do, as I am hitting a wall as it is. Any help would be appreciated. Just pointing me in the right direction might be enough.

Links to the plugins.
 

audo

Villager
Member
Joined
Oct 2, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
N/A
After days of no progress I got SRD_CameraCore.js to work by commenting out the code in Game_Screen.prototype.refreshTilemapMargin
Here is an image of a test map from tiled using stand in tiles that are 288x288.

288x288.png
Now the zoom out works but it does not load the tiles it needs to on the sides. I am going through the code and trying to get it to just permanently draw a bigger square of tiles.
 

audo

Villager
Member
Joined
Oct 2, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
N/A
It took changing 4 numbers in sequence to get it to work properly. Now inexplicably I am getting issues setting a parameter but that's an issue for another thread.
 

Latest Threads

Latest Profile Posts

I am proud of how much my friends are pure talent. This one is making my game possibilities bigger and bigger and I wanna share his word:
Fun fact. Today it's exactly 2600 days since I met my now gf for the first time. Sometimes being a programmer can be really useful. O:)
Is RPG Maker VX (rgss2) still relevant? xD
yo how do I change my profile picture?

Forum statistics

Threads
118,469
Messages
1,116,156
Members
155,450
Latest member
etflab
Top