Quantcast
Channel: JavaScript Canvas - change the opacity of image - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by ViliusL for JavaScript Canvas - change the opacity of image

You can also use save and restore.context.save();context.globalAlpha = 0.5;.... context.restore(); //this will restore canvas state

View Article



Answer by user1693593 for JavaScript Canvas - change the opacity of image

You have to either change globalAlpha or draw the image to an off-screen canvas that has globalAlpha set, then draw this canvas onto the main canvas.Just set alpha, draw the image and reset alpha back...

View Article

JavaScript Canvas - change the opacity of image

I'm trying to create a platform game in Canvas. I have main character and some enemies. When player touch enemy, he will lose some HP and he will be untouchable for about 3s. Now I have one problem....

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images