SFML community forums

Bindings - other languages => General => Topic started by: benwang08 on June 30, 2021, 06:20:39 am

Title: Help with animating non rectangular sprite
Post by: benwang08 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?
Title: Re: Help with animating non rectangular sprite
Post by: G. 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