scrolling screen in sdl/my own engine.
okay I think I am spazzing out here but this should work to make my background scroll vertically yes?
or am I missing some things >.<
I can provide my draw code if it's needed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
m_pSprite->LoadSpriteTexture( "SplashScreen.JPG","BackGround");
m_pSprite->GetTexture();
int m_iBackground = m_iTextureID;
//The offsets of the background
int bgX = 0, bgY = 0;
//Scroll background
bgX -= 2;
//If the background has gone too far
if( bgX <= -m_iBackground - 768 )
{
//Reset the offset
bgX = 0;
}
|
thanks for your time =D
Topic archived. No new replies allowed.