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.
Scrolling only one row.
Moderator: Stef
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Scrolling only one row.
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.
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*.
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.
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.
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[1] = { 8 };
VDP_setHorizontalScrollTile (PLAN_A, 0, val, 1, FALSE);
Code: Select all
s16 val[32] = { 8, 10, 16, 4, ... };
VDP_setHorizontalScrollTile (PLAN_A, 0, val, 32, FALSE);
Re: Scrolling only one row.
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.
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.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Scrolling only one row.
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.
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.