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

Author Topic: Creating a partially see-through sprite  (Read 2372 times)

0 Members and 1 Guest are viewing this topic.

TheGoldenFyre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Creating a partially see-through sprite
« on: November 07, 2015, 04:31:04 pm »
Hi!
I'm trying to create a sprite where certain areas in the sprite are see-through. Is this possible? I can't find any other forum posts about it...
(Sorry if it's really obvious...  Newbie to SFML  :P)
Please help!

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Creating a partially see-through sprite
« Reply #1 on: November 07, 2015, 04:57:32 pm »
You need to utilize the alpha channel in whatever program you are using to create your textures and save your texture with the png format.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Resethel

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • Email
Re: Creating a partially see-through sprite
« Reply #2 on: November 08, 2015, 12:57:45 am »
You can also load an image, set a mask from a color then load a texture from this image and apply it to your sprite.
But it's definitely easier to do as zsbzsb said

TheGoldenFyre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Creating a partially see-through sprite
« Reply #3 on: November 08, 2015, 09:20:24 am »
Thanks for the help! I created a mask and that worked out fine.

 

anything