Jump to content
  • Advertisement
Sign in to follow this  

Scrolling/Making only part of a sprite visible in SDL

This topic is 578 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

EDIT: I've solved my own problem, please lock/delete, thank you


Hello, I'm hoping to find some help for the UI of my sort of audio manipulation app. I'm using C++ and SDL2 for this project, but this is my first time using SDL.

The audio waveform can be sped up or slowed down, shrinking or enlarging the size of the SDL_Rect the wave form is drawn on accordingly. My problem is that when you slow the audio down the size of the waveform becomes too large to fit on the screen. So, I need some way to create a "window" where you can scroll to see the next and previous sections of the waveform. (By moving the x position of the rect, probably)

I've seen LazyFoo's scrolling tutorial: http://lazyfoo.net/tutorials/SDL/30_scrolling/index.php but I only need certain sections to be scrollable, not the whole screen. I can't keep the waveform stationary and move the rest of the app window because I might need to have two independent scrolling components.

Where the rect of the blue ones can be independently extended to be longer than the screen dimensions.

I've thought a lot about it and read the tutorial and source code but I'm really stumped. Help would be greatly appreciated!

Edited by ChosenSalad

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!