sunDalik Posted December 29, 2019 Share Posted December 29, 2019 I'm making a game with Pixi.js and I want to implement a hit effect: whenever you hit an enemy a semi-transparent red layer of the enemy's sprite shape will cover him for a second. I guess an example will explain it better, so I attached an image ? The question is what are the ways to implement it? I can't come up with any. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 30, 2019 Share Posted December 30, 2019 > The question is what are the ways to implement it? I can't come up with any. It looks like our "examples" page is not visible enough in the web. 0. ColorMatrixFilter, but its a filter, it uses extra framebuffer and it can be slow for many objects. https://pixijs.io/examples/#/filters-basic/color-matrix.js Cheap solutions: 1. "tint" parameter:https://pixijs.io/examples/#/demos-basic/tinting.js 2. you can use https://github.com/gameofbombs/pixi-heaven1 plugin to tint both black and white : https://pixijs.io/examples/#/plugin-heaven/invert.js Welcome to the forums! sunDalik 1 Quote Link to comment Share on other sites More sharing options...
sunDalik Posted December 30, 2019 Author Share Posted December 30, 2019 (edited) 10 minutes ago, ivan.popelyshev said: > The question is what are the ways to implement it? I can't come up with any. It looks like our "examples" page is not visible enough in the web. 0. ColorMatrixFilter, but its a filter, it uses extra framebuffer and it can be slow for many objects. https://pixijs.io/examples/#/filters-basic/color-matrix.js Cheap solutions: 1. "tint" parameter:https://pixijs.io/examples/#/demos-basic/tinting.js 2. you can use https://github.com/gameofbombs/pixi-heaven1 plugin to tint both black and white : https://pixijs.io/examples/#/plugin-heaven/invert.js Welcome to the forums! Oh wow thanks! Looks like exactly what I need. Gonna bookmark that examples page... Edited December 30, 2019 by sunDalik ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 30, 2019 Share Posted December 30, 2019 Also bookmark wiki , here's one of the pages: https://github.com/pixijs/pixi.js/wiki/v5-Hacks And the best document is the source code, if you are proficient with IDEs (vscode, intellij idea/webstorms), just clone this thing and open in separate window to search classes faster: https://github.com/pixijs/pixi.js . There are many places in PixiJS that are very stupid and easy to hack if you see that you need different behaviour. sunDalik 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.