Page 1 of 1

Scrolling?

Posted: Sat 14 Apr, 2007 9:31 pm
by ProphetsDementia
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.)

Posted: Sun 15 Apr, 2007 3:56 am
by kalan_vod
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

Posted: Sun 15 Apr, 2007 8:10 am
by King Harold
If you want smooth scrolling you'll have some more work to do.. Do you need smooth scrolling? I'm not 100% sure how it works though..

anyway, you should have checks to see that you don't start at a negative place and that you won't 'go over the edge' at the right and bottom sides.

Posted: Sun 15 Apr, 2007 7:58 pm
by kalan_vod
Smooth scrolling is not something I would incorporate into basic.

Posted: Mon 16 Apr, 2007 3:00 pm
by King Harold
neither would I, but it is ProphetsDementia's project

Posted: Thu 30 Aug, 2007 4:21 am
by dysfunction
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.

Posted: Thu 30 Aug, 2007 3:00 pm
by kalan_vod
dysfunction wrote:Yes, your friendly neighborhood dysfunction is back. Sort of.
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).

Posted: Thu 30 Aug, 2007 3:39 pm
by tr1p1ea
Image

Theres the screenie :).

Posted: Thu 30 Aug, 2007 5:55 pm
by dysfunction
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).

Posted: Fri 31 Aug, 2007 12:58 am
by tr1p1ea
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.

Posted: Fri 31 Aug, 2007 3:09 pm
by dysfunction
Ah, I see. And actually, strike my last about scrolling screen-sized sprites being buggy. The issue doesn't seem to appear anymore.

Posted: Fri 31 Aug, 2007 8:59 pm
by DJ_O
darn I am almost tempted to post this pic on my forum, but I'm sure invisionfree will claim it's porn and delete my board <_<

Posted: Sat 01 Sep, 2007 1:40 am
by kalan_vod
DJ Omnimaga wrote:darn I am almost tempted to post this pic on my forum, but I'm sure invisionfree will claim it's porn and delete my board <_<
Nah, but it would be a nice avatar ;)..