help with minimap using spritesetmap :D

i write some plugin to use in my own project...

it's for making minimap... but instead needing to mapshot the map and using that picture... (this minimap is for lazy person btw)

i decide to instead create another spriteset map... which i scaled down...

i also make it to cover more ground (2 times of what regular map shown. since what the use of minimap if it show exactly like map)...

here's the plugin btw:

https://www.dropbox.com/s/7dtrpzri6yvlgj4/EST_SIMPLE_MINIMAP.js?dl=0

WARNING: since this still experimental... i mostly use overwrite for now... also the position and scale of minimap is still hardcoded.

but i encounter some problem...

first... take a look at this screenshot:

screenshot_814.jpg


soo... the first problem is the minimap is not centered on player. when i enlarge the tilemap width and height... it's not centering it at the player. thus you cannot see what exist after at top and left of your map from minimap....

the second problem is the event graphic is drawn but it's drawn for whole map. >.<. so it's got out of bound... any way to mask the event that out of bound?

the most confusing thing is how to make the minimap centered on player... i try many things and it don't work.

(some of them including modifying tilewidth and tileheight instead of enlarging width and height. but it draw blank image.

i also try to modify tile map origin.x and origin y but it doesn't have any effect)

so anyone who have advice on what function that i should look at would be helpful.

thanks for reading and helping 😀 .
Not sure if this will help. But one issue I see is that you added all the extra padding to the bottom and right side of the tilemap, when it should have been equal padding on all sides, at least I think that's what you were going for. So all you have to do is just shift the origins by 1/2 of the size like:

Spriteset_MiniMap.prototype.updateTilemap = function() { this._tilemap.origin.x = $gameMap.displayX() * $gameMap.tileWidth(); this._tilemap.origin.x -= this._tilemap.width / 2; this._tilemap.origin.y = $gameMap.displayY() * $gameMap.tileHeight(); this._tilemap.origin.y -= this._tilemap.height / 2;};But this only shifts the tilemap. So you will have to add in an update function to shift the characters by that 1/2 as well. In that function you could also check if that character sprites x / y are in the minimap, and if they aren't hide them.

You might also want to use like $gamePlayer.x / y instead of $gameMap.displayX() / Y() since display values won't be centered near edges of maps. But you will also have to apply this change to the sprite characters as well since they use the display values for their location.
Check out my minimap display I have it centered on player. I ahve no clue if I am using the right method. I don't have a clue what origin or anchor even mean.

You can copy what I did it may or may not help you.
I started a minimap plugin once, over a month ago, and I think I had those things fixed.

Here's a copy of the code: https://github.com/Hudell/mv-plugins/blob/backup/OrangeMiniMap.js

I had dropped this because I had decided it wasn't the best approach and wanted to start over, but never did.
Check out my minimap display I have it centered on player. I ahve no clue if I am using the right method. I don't have a clue what origin or anchor even mean.

You can copy what I did it may or may not help you.
thanks... i will look at that as reference

I started a minimap plugin once, over a month ago, and I think I had those things fixed.

Here's a copy of the code: https://github.com/Hudell/mv-plugins/blob/backup/OrangeMiniMap.js

I had dropped this because I had decided it wasn't the best approach and wanted to start over, but never did.
this really look promising... i will look at that... using tilemap is because i'm too lazy to create mapshot 😀 .

Not sure if this will help. But one issue I see is that you added all the extra padding to the bottom and right side of the tilemap, when it should have been equal padding on all sides, at least I think that's what you were going for. So all you have to do is just shift the origins by 1/2 of the size like:

Spriteset_MiniMap.prototype.updateTilemap = function() { this._tilemap.origin.x = $gameMap.displayX() * $gameMap.tileWidth(); this._tilemap.origin.x -= this._tilemap.width / 2; this._tilemap.origin.y = $gameMap.displayY() * $gameMap.tileHeight(); this._tilemap.origin.y -= this._tilemap.height / 2;};But this only shifts the tilemap. So you will have to add in an update function to shift the characters by that 1/2 as well. In that function you could also check if that character sprites x / y are in the minimap, and if they aren't hide them.

You might also want to use like $gamePlayer.x / y instead of $gameMap.displayX() / Y() since display values won't be centered near edges of maps. But you will also have to apply this change to the sprite characters as well since they use the display values for their location.
i work some of this and manage to make it centered. but still have lots of problem... i don't know... after i learn from 2 plugin above i will try again working on the code. if i cannot fix all the problem... i might postpone this until i'm more familiar with JS.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-minimap-using-spritesetmap-d.52570/