Archived

This topic is now archived and is closed to further replies.

smooth scrolling

This topic is 5740 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a little isometric Tile engine, but how can I make a much smoother scrolling (not everytime one Tile wide)?? Ash nazg durbatulûk, ash nazg gimbatul, ash nazg thrakatulûk agh burzum-ishi krimpatul.

Share this post


Link to post
Share on other sites
Your background buffer (before you do the flip) should be one tile larger on each side than your primary surface.

--LordKaT

Share this post


Link to post
Share on other sites
I can make the backbuffer bigger than the primary surface? I heard that it only could be as big as the primary surface.

anyway. My render routine looks like this (Attention it''s VB )

Spos is for the scrollposition

With rTile
.Left = 0
.Top = 0
.Right = TILE_X_SIZE
.Bottom = TILE_Y_SIZE
End With

For Y = -1 To Int(NUM_X_TILES)
For X = -1 To Int(NUM_Y_TILES)
mapX = Spos.X + X + Y
mapY = Spos.Y - X + Y
If OnMap(mapX, mapY) = True Then
DrawTile (X * TILE_X_SIZE), (Y * TILE_Y_SIZE), TileMap(mapX, mapY), rTile
End If
Next X
For X = -1 To Int(NUM_X_TILES)
mapX = Spos.X + X + Y
mapY = Spos.Y - X + Y + 1
If OnMap(mapX, mapY) = True Then
DrawTile (X * TILE_X_SIZE - (TILE_X_SIZE / 2)), (Y * TILE_Y_SIZE + (TILE_Y_SIZE / 2)), TileMap(mapX, mapY), rTile
End If
Next X
Next Y

as you see when I scroll 1 Unit to right it will move 1 Tile wide to right. How can I do it that it will move only a half or a quarter to right or the other directions.





Ash nazg durbatulûk, ash nazg gimbatul, ash nazg thrakatulûk agh burzum-ishi krimpatul.

Share this post


Link to post
Share on other sites