Page 1 of 1
Scrolling only one row.
Posted: Thu Sep 12, 2019 9:52 pm
by m4x1k
Hello. I’m trying to understand how’s tile scrolling works. How can I move one row to the right/left?
I made and image on plan A.
For example, VDP_setHorizontalScroll (PLAN_A,
works fine. It moves whole plan 8 pixels to the right. But I need to move only one row.
I set tile scrolling with VDP_setScrollingMode.
VDP_setHorizontalScrollTile (PLAN_A, 0, 8, 1, FALSE) is not working that way. Can someone explain me how can I do one row scrolling?
Can’t find any info on the forum. Only whole background scrolling.
Re: Scrolling only one row.
Posted: Fri Sep 13, 2019 10:21 am
by Stef
You need to set the current scroll mode first using VDP_setHorizontalScrollMode(..) or something like that (on my phone currently).
Re: Scrolling only one row.
Posted: Fri Sep 13, 2019 12:42 pm
by m4x1k
Stef, hello. I do use VDP_setHorizontalScrollMode as I mentioned it in my previous post. Set it to TILE scroll.
Then I use VDP_setHorizontalScrollTile (PLAN_A, 0, 8, 1, FALSE) to scroll first row on the screen 8 pixels to the right. Is this how it supposed to work or I do something wrong? Because CodeBlocks give me an Warning about 3rd argument as it should be not int but s16*.
Re: Scrolling only one row.
Posted: Fri Sep 13, 2019 2:54 pm
by Grind
It wants an array of values to set the scroll lines to rather than a single value. If you are only scrolling one line the array only needs to have one element.
Code: Select all
s16 val[1] = { 8 };
VDP_setHorizontalScrollTile (PLAN_A, 0, val, 1, FALSE);
The 4th argument is the length of the array so you could do the whole plane in one if you want.
Code: Select all
s16 val[32] = { 8, 10, 16, 4, ... };
VDP_setHorizontalScrollTile (PLAN_A, 0, val, 32, FALSE);
Re: Scrolling only one row.
Posted: Fri Sep 13, 2019 3:50 pm
by m4x1k
Grind, thank you.
Now I understand.
Do sgdk have some chat where I can ask some questions? I have so many of them and I just don’t want to open new tread for each one.
Re: Scrolling only one row.
Posted: Sat Sep 14, 2019 6:07 pm
by Stef
Oh sorry I read too quickly your message
Indeed it was related to how you passed parameters.
Also there is a Discord server for SGDK, you have the link in the SGDK readme.txt file.