How to add billboards to Mode 7 Shader
Recently, I was asked how to implement a billboard (a static sprite that doesn't move relative to the ground) into my Mode 7 Shader for GameMaker Studio 2. I did implement it before and it's very easy to do, so I quickly threw together this guide on how to:
- Create a sprite you wish to use as a billboard. Similar to the player car sprite, it's important that the origin point is in the bottom-centre of the sprite.
- Clone the player object (either is fine, just make sure to reference the correct Mode 7 shader in it) or create a new object and copy the player object's events to it. Assign your sprite to it.
- In the step end Event, remove the first two lines of code, leaving only the updating of image_angle. Those lines updated the absolute position of the player so by leaving them out, the position of the billboard won't change. Leave the draw event as it is.
- Place the billboard object in the room where you want to have it be.
- That's it! Starting the project now should draw a billboard at the coordinates at which the object was placed in the room. Scaling will work as expected.
This simple system is compatible with all camera adjustments, however the size of the billboard sprite, as with the player sprite, will not change. I have yet to find a way to make depth work according to the relative horizontal position of the sprite on-screen. Due to how GameMaker is set up, you cannot simply change the depth of a sprite in the draw event.
Still, I hope this guide is useful to some. I hope you will continue to enjoy Mode 7 Shader for GameMaker Studio 2!
Get Mode 7 Shader for GameMaker Studio 2
Mode 7 Shader for GameMaker Studio 2
A new way to look at top-down games!
Status | Released |
Category | Assets |
Author | MrLevRocks |
Tags | Asset Pack, GameMaker, mode-7, mode7, Shaders, sourcecode |
Leave a comment
Log in with itch.io to leave a comment.