• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

HTML5 Transparent canvas in HTML5

D

DigitalClark

Guest
Hello dear GameMaker Community,

yesterday I posted a very similar post (sorry for that, but you can find it here), but I felt like I posted into the wrong board and didn't express my problem sufficiently. In a nutshell, I have a HTML5-Game which's canvas/ background I want to be completely transparent, except the instances drawn on the screen. I've read in the manual (here) that you can do this, so I thought I'd give it a try.
I did everything that the manual provided, creating a new instance in the first room of the game with a depth of -1000000 and having the code
Code:
draw_clear_alpha(c_white, 0);
in the Pre-Draw-Event of the (visibile) object. I also unticked "Clear Background with Window Colour" in the Views-Tab and "Draw background color" in the Backgrounds-Tab (, also as stated in the manual) in every room of my game.
I also tried editing the compiled index.html, removing the background-colour hex's from the body-tag stylesheet and replacing the background with an image, just to see if the game is transparent at all.

My problem now is, that even tough every instance and text gets drawn normally on screen in my browser, the background is always plain black in everyroom (take in mind I unticked "Clear Background with Window Colour" in the Views-Tab and "Draw background color" in the Backgrounds-Tab). Changing the draw_clear_alpha(col, alpha); code in the Pre-Draw-Event doesn't even seem to do anything, also when I blend 50% alpha with red or something. Does the clear-alpha-instance need to be persistent? What am I missing? Is this a GameMaker Bug or is GM:S simply not capable of doing such things?

I hope you can help me and sorry for the (kinda) double post,
have an amazing day,
DigitalClark :)!



Using GameMaker Studio: Professional (1.4.1788).

Any idea anyone? I know this is a pretty specific question for a feature that you don't usually use that often in game development, but I'd still be happy if I'd finally get this stuff to work :). According to the manual it should be (kind of) possible...
(sorry for the double post guys ♥)
 
Last edited by a moderator:
Top