So basically you want to draw a partially-transparent 32x32 bitmap over the tile.
48x48 but yes
🙂
I am currently investigate the ShaderTilemap class. Hoping I'll figure out how to do this soon enough. But currently I am just trying to figure out what tileId is more specifically.
JavaScript:
ShaderTilemap.prototype._drawNormalTile = function(layer, tileId, dx, dy) {
var setNumber = 0;
if (Tilemap.isTileA5(tileId)) {
setNumber = 4;
} else {
setNumber = 5 + Math.floor(tileId / 256);
}
var w = this._tileWidth;
var h = this._tileHeight;
var sx = (Math.floor(tileId / 128) % 2 * 8 + tileId % 8) * w;
var sy = (Math.floor(tileId % 256 / 8) % 16) * h;
layer.addRect(setNumber, sx, sy, dx, dy, w, h);
};
And sadly I am unable to set which bitmap to use as tileset here, so I kinda know that I am using the wrong class... Yet, the "Tilemap" class doesn't seem to exist or it exists outside the stack trace feature, somehow... Perhaps it is created in such a way that the
created object just doesn't reference the original class lines?
(Does not freeze at this line, or any other line within this function or other Tilemap.prototype.functions I've tried it with.
This means I can't create a reference to the tilemap, which might be better since it actually requests a bitmap rather than layer. This depends on wheter or not Tilemap is actually being used.
Currently in the ShaderTilemap I have added a line "tilemap = this;". Giving me the option to go over the class/object in the console. And simply experiment.
JavaScript:
Tilemap.prototype._drawNormalTile = function(bitmap, tileId, dx, dy) {
var setNumber = 0;
if (Tilemap.isTileA5(tileId)) {
setNumber = 4;
} else {
setNumber = 5 + Math.floor(tileId / 256);
}
var w = this._tileWidth;
var h = this._tileHeight;
var sx = (Math.floor(tileId / 128) % 2 * 8 + tileId % 8) * w;
var sy = (Math.floor(tileId % 256 / 8) % 16) * h;
var source = this.bitmaps[setNumber];
if (source) {
bitmap.bltImage(source, sx, sy, w, h, dx, dy, w, h);
}
};
And, I don't know if "Normal" is what I am after, but seems to be a decent starting point at least.
And since I do not know how the (Shader)Tilemap works, it is very possible that it loops over several times, meaning that my variable "tilemap" is just referencing a useless object that can't do anything anymore. I have noticed that "paintTiles" and similar functions do work. But the draw functions, are so far useless.
The last command I tried was:
JavaScript:
tilemap._drawNormalTile(tilemap.upperLayer, 114, $gamePlayer.x, $gamePlayer.y);
I am using the $gamePlayer coords because it should then display any newly painted tile above or below the player.
Where tilemap is a reference to the last created ShaderTilemap object. Assuming they are created of course. I assume this as the functions in the class are preceeded with the "prototype". Which tells me that it's probably a constructor. But I have quite limited experience so I could be wrong.
so basically you want to mark an area on the map without completely hiding it?
then you have two different options, both requiring plugins for different functions.
the first would be a change tile plugin giving you a script command to change a tile on the current map.
this would be the better solution for performance especially on large areas, but requires you to have thegreen glow as a tile in the tileset of the map.
the second option is to have a clone event plugin and create copies of a decorative event containing the green glow. This has two disadvantages of requiring a lot of events and possibly causing problems if there are already other events in the target position, but would work even if the tileset has no place for the additional tiles required by the first solution.
Yes, I already have an event spawner, but as you state, it wouldn't be very efficient. Therefore I stray away from that solution.
Alright, if those are the only two options, I shall keep looking within the ShaderTilemap class to see if I can figure out how to simply place a tile on x,y and top layer.