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

Author Topic: Help with animating non rectangular sprite  (Read 2521 times)

0 Members and 1 Guest are viewing this topic.

benwang08

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Help with animating non rectangular sprite
« on: June 30, 2021, 06:20:39 am »
I'm pretty new to sfml, I want to make a simple game.
One thing i'm having trouble with is complex sprites.

For example, in my game I want a cannon shaped sprite (one found online), that moves angles based on the users input. I also want a background, for example a blue sky. I roughly know how to animate a sprite, But as far as i'm aware, its pretty difficult to set the boundaries for complex shapes. If i put the cannon sprite in a basic rectangular shape, then wouldn't there be a rectangular boundary around the cannon sprite? and if I wanted it animated, i'm having trouble figuring out how I could put the background around the cannon, without this border.

If it wasn't animated, I could maybe just put the background inside the sprite itself. But even then, what if I wanted a moving background with clouds or whatnot?

G.

  • Hero Member
  • *****
  • Posts: 1527
    • View Profile
Re: Help with animating non rectangular sprite
« Reply #1 on: June 30, 2021, 12:38:36 pm »
I'm not totally sure what you mean, but you can make the background of your sprite transparent (directly in the PNG) and anything you put behind it will be viewable

 

anything