#### Archived

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

# smooth scrolling

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

## 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 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 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.

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
16
5. 5

• 14
• 29
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631773
• Total Posts
3002268
×