flame-engine / flame

A Flutter based game engine.
https://flame-engine.org
MIT License
9.29k stars 913 forks source link

Problem with alpha in web #309

Closed billy1380 closed 4 years ago

billy1380 commented 4 years ago

I have been working on a port of the godot game "Blaster Faster".

https://www.youtube.com/channel/UChv-gaPlKNROf6iMDhxIpUA/videos

I finished the port but when I ran it on web transparency/alpha does not seem to work as expected.

Mac OS

Screenshot 2020-05-03 at 20 22 30

Web

Screenshot 2020-05-03 at 20 21 24

I have ported other flutter apps to web and as far as I know there is no issue with alpha. Any thoughts?

billy1380 commented 4 years ago

Can also be viewed here

https://www.willshex.com/blasterfaster/#/

erickzanardo commented 4 years ago

Hey, before we go any further on this, keep in mind that the web support is really experimental, as Flutter is still on beta and many things are unstable, Flame does little regarding the graphics APIs, so many issues come directly from Flutter itself and there is little we can do.

By looking on your screenshot, it seems that you are not using the use skia flag to run your game, can you confirm that? If you indeed aren't using it, give it a try, just run:

$ flutter run --release -d Chrome --dart-define=FLUTTER_WEB_USE_SKIA=true

If that don't work as well, please tell us more how are you rendering, and share some code as well.

billy1380 commented 4 years ago

@erickzanardo I just did a build using SKIA and it worked perfectly. Many thanks. Happy to close this.

erickzanardo commented 4 years ago

Awesome, glad you got this working!