Overwriting the Player's Rendering
Posted: Wed Feb 21, 2024 3:10 pm
by ThEnderYoshiHD
I'm making a custom NPC where, under certain conditions, I need to draw the player as their small form and with a shader applied.
Player:render() seems like the way to go, but it doesn't replace the original sprite.
How do I stop the original sprite from being drawn?
Re: Overwriting the Player's Rendering
Posted: Thu Feb 22, 2024 7:34 am
by Marioman2007
You can do "player.frame = -50 * player.direction" in onTickEnd or onDraw to hide the vanilla player rendering.
Though you will need to pass a frame number in the player:render call because it uses the vanilla player frame by default.
Re: Overwriting the Player's Rendering
Posted: Thu Feb 22, 2024 12:22 pm
by ThEnderYoshiHD
Marioman2007 wrote: ↑Thu Feb 22, 2024 7:34 am
You can do "player.frame = -50 * player.direction" in onTickEnd or onDraw to hide the vanilla player rendering.
Though you will need to pass a frame number in the player:render call because it uses the vanilla player frame by default.
It worked!
Also I needed to set
frame anyway since I wanted a specific frame from a specific powerup.
