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

Author Topic: Merging two textures/images  (Read 3748 times)

0 Members and 1 Guest are viewing this topic.

Doodler

  • Newbie
  • *
  • Posts: 1
    • View Profile
Merging two textures/images
« on: August 08, 2019, 09:02:17 pm »
So basically sorry if this is obvious to do, but what I’m trying to figure out is to combine two textures I have(both 80 by 80 pixels) into one before putting it on a sprite.

My player has two separate moving components the bottom that animates based on the direction of the player, and the top which switches textures to point in the direction the player is facing.

I don’t want to combine them because it would increase my images from 2 spritemaps of 8 to 1 spritemap of 64

Geheim

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Email
Re: Merging two textures/images
« Reply #1 on: August 08, 2019, 09:44:28 pm »
Have you seen sf::RenderTexture yet? You can just draw your individual parts on one of them and use the combined texture for your sprite.
Another way would be to just draw them separately. If the parts overlap you might want to use an apropriate BlendMode.
Failing to succeed does not mean failing to progress!