Scrolling?
Moderator: tr1p1ea
- ProphetsDementia
- Regular Member
- Posts: 81
- Joined: Wed 06 Dec, 2006 2:20 am
- Location: Tokyo, Kanto, Japan
Scrolling?
I have a question about xLib. I understand how to scroll the screen but, it seems to have trouble scrolling farther than 7 x 11. I am trying to make a platformer but I can't go to other parts of the map and I can't get CreateTileMap to draw one part of a larger matrix.
Any suggestions or advice?
Thanks,
ProphetsDementia
(P.S. My new project is called Kaze no Tsuraga (pronounced Ka-say NO Sue-ra-ga) AKA Tsuraga of the Wind.)
Any suggestions or advice?
Thanks,
ProphetsDementia
(P.S. My new project is called Kaze no Tsuraga (pronounced Ka-say NO Sue-ra-ga) AKA Tsuraga of the Wind.)
Make sure you have a variable that is used for the changing of the screen, where you change your X_Offset and/or Y_Offset.
Code: Select all
real(2,Matrice_Name,X_Offset,Y_Offset,MapWidth,MapHeight,ScreenStartX,
ScreenEndX,ScreenStartY,ScreenEndY,mPIC_Num,Tile_Method,Tile_Size,Map_UpdateLCD
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
- dysfunction
- Calc Master
- Posts: 1454
- Joined: Wed 22 Dec, 2004 3:07 am
- Location: Through the Aura
Smoothscrolling can be done decently with xlib, actually. Just buffer your tilemap into pics first. The main problem is that displaying and scrolling very large (i.e., screen-sized) sprites is somewhat buggy at the moment.
Yes, your friendly neighborhood dysfunction is back. Sort of.
Yes, your friendly neighborhood dysfunction is back. Sort of.
"You're very clever, young man, but it's turtles all the way down!"
Good to see you are back, and you are right..Check out the SS from this sub forum, and you will find a pic of tr1p1ea showing a girl from FF which is smooth scrolling I believe (if it is not you could do 2 pixel scrolling).dysfunction wrote:Yes, your friendly neighborhood dysfunction is back. Sort of.
- dysfunction
- Calc Master
- Posts: 1454
- Joined: Wed 22 Dec, 2004 3:07 am
- Location: Through the Aura
Actually I never got around to asking you, tr1p, but one thing has been bugging me. When scrolling sprites with overwrite logic, why is it necessary to clear the screen each frame before drawing the sprites to prevent weird lines from showing up?
Also, I need to get around to giving you code to demonstrate the whole stuff-only-appearing-off-the-edge-of-the-screen-when-aligned-when-scrolling-horizontally -with-ld-logic thing. Let me upgrade to the latest version and make sure it still happens...
Also while I'm sort of on the subject, I've got one more feature request (poor tr1p). With some sprite libraries (including, iirc, the original xlib), when you moved a sprite partially off the screen it would wrap back around on the other side. Would it be possible to have that as an option? It would be very useful for repetitive scrolling backgrounds. That way you would only have to be displaying a single 96x64 sprite, rather than 2 (if only scrolling vertically or horizontally) or 4 (if scrolling BOTH vertically and horizontally).
Also, I need to get around to giving you code to demonstrate the whole stuff-only-appearing-off-the-edge-of-the-screen-when-aligned-when-scrolling-horizontally -with-ld-logic thing. Let me upgrade to the latest version and make sure it still happens...
Also while I'm sort of on the subject, I've got one more feature request (poor tr1p). With some sprite libraries (including, iirc, the original xlib), when you moved a sprite partially off the screen it would wrap back around on the other side. Would it be possible to have that as an option? It would be very useful for repetitive scrolling backgrounds. That way you would only have to be displaying a single 96x64 sprite, rather than 2 (if only scrolling vertically or horizontally) or 4 (if scrolling BOTH vertically and horizontally).
"You're very clever, young man, but it's turtles all the way down!"
- tr1p1ea
- Maxcoderz Staff
- Posts: 4141
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: I cant seem to get out of this cryogenic chamber!
- Contact:
The 'wrapping horizontally' wasnt wrapping at all, it was due to the fact that the sprite routine wasnt a clipped one. If you look carefully you will notice that if you go off the right edge, it will appear 1-pexil further down on the left when it wraps. This is actually a problem and the sole reason why we have 'clipped' sprite routines since if you were to move off the bottom-right edge, you would overwrite memory that you shouldnt when it wraps down.
- dysfunction
- Calc Master
- Posts: 1454
- Joined: Wed 22 Dec, 2004 3:07 am
- Location: Through the Aura