Jump to content
  • Advertisement
Sign in to follow this  
ManInTheBox

some questions ( SDL )

This topic is 4240 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!