Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How do i make my bitmap transparent? sfml2.0  (Read 1981 times)

0 Members and 1 Guest are viewing this topic.

Assassinbeast

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Email
How do i make my bitmap transparent? sfml2.0
« on: October 21, 2012, 02:18:21 pm »
In 2.0 theres no "CreateMaskFromColor" from my textures.
So how do i make my background transparent if my images aint png files?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: How do i make my bitmap transparent? sfml2.0
« Reply #1 on: October 21, 2012, 02:23:48 pm »
It still exists, see here. ;)

The thing is that texture.loadFromFile() actually is simply a shorthand for loading it into an image and then copying it to a texture.

So what you have to do is load it into a sf::Image set the wanted transparent color and retrieve the texture.

Another option would be to mask the background color in a image editor and set it to transparent. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Assassinbeast

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • Email
Re: How do i make my bitmap transparent? sfml2.0
« Reply #2 on: October 22, 2012, 12:06:38 am »
It still exists, see here. ;)

The thing is that texture.loadFromFile() actually is simply a shorthand for loading it into an image and then copying it to a texture.

So what you have to do is load it into a sf::Image set the wanted transparent color and retrieve the texture.

Another option would be to mask the background color in a image editor and set it to transparent. ;)


Ahh ok ty :)

 

anything