I have a game with a HUD which is drawn by
How would I fade these rectangles when the player is on the HUD?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
You can start a new thread, create a loop inside, and invoke this every few ms:
// decalre a golbal int i i = (i + 1) % 0xFF Color color = new Color(i, [your color], [your color], [your color]); g.setColor(myColour); // graphics context object
And you'll see your canvas fading.