Using SGDK's VDP_setHorizontalScroll()
Posted: Sun Feb 19, 2012 2:59 pm
I have a few basic questions about VDP_setHorizontalScroll() as I'm not sure what kind of behaviour I should be expecting. I've seen other threads about the topic but I still haven't been able to wrap my head around it.
- To confirm: If I want to scroll the whole background layer as one big piece, as opposed to line-by-line, would I just call VDP_setHorizontalScroll(APANE, 0, myScrollValue) ? I've tried this and it appears like it works that way.
- If I wanted to scroll a background layer line-by-line, don't I just call VDP_setHorizontalScroll for each line with their own scrolling value?
- Is the number of scrollable lines dependant on the height of the background layer or the height of the screen?
- When is the best time to call VDP_setHorizontalScroll? I've seen examples where its set during HBLANK, some not. In my own code, I'm calling it in a while loop in the main function.
- Somewhat related, when is the best time to update game code? Like my question above, I'm not sure if I should be doing game logic in a while loop in my main function or if I should be doing it in a blanking callback function.
Thanks!
DJCC.
- To confirm: If I want to scroll the whole background layer as one big piece, as opposed to line-by-line, would I just call VDP_setHorizontalScroll(APANE, 0, myScrollValue) ? I've tried this and it appears like it works that way.
- If I wanted to scroll a background layer line-by-line, don't I just call VDP_setHorizontalScroll for each line with their own scrolling value?
- Is the number of scrollable lines dependant on the height of the background layer or the height of the screen?
- When is the best time to call VDP_setHorizontalScroll? I've seen examples where its set during HBLANK, some not. In my own code, I'm calling it in a while loop in the main function.
- Somewhat related, when is the best time to update game code? Like my question above, I'm not sure if I should be doing game logic in a while loop in my main function or if I should be doing it in a blanking callback function.
Thanks!
DJCC.