How to draw shapes on a game map?

I need to learn how to draw simple, flat (but semi-transparent) shapes on top of the game map, in a plugin. As in, covering a number of map squares with tinted rectangles, for example.

I think I need to create a graphical object, set opacity, and use the fillRect method. But is there a RMMV-specific way of doing this that I need to learn (pointers appreciated!) or should I look at the general Pixi docs? Or something else? (I've been looking at the RMMV library docs and the TerraxLighting code so far.)

Thanks!
I haven't clearly understood... but as i understood, maybe parallax mapping will help you
that has nothing to do with parallax, but what is the exact purpose for this part?
there is a plugin out there that make it where teh player can walk and/or where not.

you can look at that plugin and see if that is what you need or similair, so
you can check the plugin how to draw those for your purpose.

the plugin can be found here. if you want to make polygons, it require a different methode.
Thanks for the replies! I have everything I need except a statement that basically does:

draw a filled rectangle of size (w,h) at (x,y)

I think it must be something close to what's used in TerraxLighting for the lighting effects, where he draws a gradient on the map, but mine is simpler. But I'm having a hard time understanding from that code (and the RMMV library docs) how to do this sort of thing in general. I'm not sure whether it's an RMMV specific thing I need to do, or if I can use standard JavaScript/Pixi methods.

I'll experiment a bit with the TerraxLighting code and see what happens.
You can use PIXI.Graphics to draw a rectangle on the map, but the way I've currently got for doing it just draws it on the screen and it doesn't move with map scroll.
the plugin can be found here. if you want to make polygons, it require a different methode.

I only noticed this link now, that does look like the right sort of thing, thanks!

Edit: And it's a super short bit of code too, glorious! :^)
You can use PIXI.Graphics to draw a rectangle on the map, but the way I've currently got for doing it just draws it on the screen and it doesn't move with map scroll.

Right. Good point, thanks.
Just noting that if you needed more than just rectangles, there's a plugin here that appears to do that. (I'm referring to the utility plugin in that post, not the battle overview scene.)
Alright, I've tried to read the Trb_VisualizationPassable.js code (link in ShadowDragon's post above), and I think I need to read a book on how to draw graphics in JavaScript to get this to work.

Here's what I want to do: I have a function which checks whether an event/player/follower can see another event/player/follower. It calculates line-of-sight in three dimensions, using region IDs for height information. (You can see it here.)

Now I want to draw the view cone of an event on the map (like in many stealth games). But I don't want it to be a regular cone. I want to highlight precisely the map squares where the event could spot the player. The whole point of checking line-of-sight in 3D is that it's possible to hide below a ledge, unless a guard above the ledge walks up right to the edge. So, some squares within the view cone will nevertheless be "in shadow" and that should be visible when the view cone is drawn.

I have the code for determining what squares should be highlighted. I just don't know how to actually highlight them. :^) Looking at Trb_VisualizationPassable.js, it seems as though I need to first create a layer, and a bitmap object to fill that layer with. My problem is that I don't know the process here, what layers really are, when and how and how often these are updated in the main game loop, etc. (I've been looking at the ShaderTilemap class, among other things.)
I figured this out eventually. What I did was to create a PIXI sprite container of the same size as the map, align it with the map using $gameMap.screenX() etc, fill the container with a grid of tile-sized sprites, and then change the opacity of these sprites to highlight the view cone of a character. I'm testing on a 100x100 map (so 10,000 sprites) and performance doesn't seem to be a problem.

You can see what it looks like here.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-draw-shapes-on-a-game-map.124309/