Sign in to follow this  

some questions ( SDL )

This topic is 4025 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

1) I use SDL and I have a 16 x 16 pixel .GIF image with 2 frames. The problem is that when I load that file in my game, the image only shows up with a single frame. Is there a way to display the sprite with the 2 frame animation in the game? Also, if I resize the .gif image it automatically loses the second frame, so it's no longer an animated gif. Is there a fix to that? 2) In SDL, how can I display text on the screen in more than one line in case it all doesn't fit on that single line? example: production = TTF_RenderText_Solid(font, " A M a n I n T h e B o x Production", textColor); apply_surface(5, 25, production, screen); say that only "A M a n I n T h " fits in one horizontal line on the screen, how can I skip a line and continue the message on the same background? Thanks.

Share this post


Link to post
Share on other sites
1) I'd split the animation into individual frame images using imageready.

2) Short Answer : SDL_ttf doesn't have the functions built it. You'll have to chop it up yourself.

Long Answer: Or you can take at look at my bitmap font tutorial to see how to make a bitmap font engine. Instead of having an array of clipped sprites, you can have an array of surfaces by rendering each letter individually. If you understand how text is made from individual character surfaces it shouldn't be too hard to add word wrap to a fonting engine like mine.

Share this post


Link to post
Share on other sites

This topic is 4025 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this