fumieval / free-game

The free game engine
http://hackage.haskell.org/package/free-game
BSD 3-Clause "New" or "Revised" License
64 stars 15 forks source link

Bitmap opacity #36

Closed Fuuzetsu closed 10 years ago

Fuuzetsu commented 10 years ago

I'd like to change the opacity of my rendered bitmap. Something like

color (Color 0 0 0 x) $ … does not do what I want because it also changes the colour of the whole thing while I'm only after the opacity. Currently it would seem that we'd have to manually generate new bitmaps. I think that free-game sits on top of Juicy-Pixels so I think this should be fairly easy to expose. Maybe free-game could expose the underlying pixel array so that users can use Juicy-Pixels themselves if they want? There seems to be no way to go convert between now.

myuon commented 10 years ago

@Fuuzetsu Try color (Color 1 1 1 t). This preserves red, green, blue color and changes its opacity.

fumieval commented 10 years ago

@Fuuzetsu Do you mean that the problem is that color (Color r g b 1) $ color (Color 1 1 1 a) $ something changes only the opacity of something, not multiplying two colors?

Fuuzetsu commented 10 years ago

Seems that Color 1 1 1 a will work. All this time I thought it was out of 255…!