14-04-2009, 03:12 AM
Here's my clipper code (Dugor helped with it a long time ago, makes surfaces not disappear when off screen):
Just change the Anim_Size stuff to whatever the size of the surface is.
Code:
If Y < 0 Then
rec.Top = rec.Top - Y
Y = 0
End If
If X < 0 Then
rec.Left = rec.Left - X
X = 0
End If
If X + Anim_Size(AnimNum).SizeX > DDSD_BackBuffer.lWidth Then
rec.Right = rec.Right - (X + Anim_Size(AnimNum).SizeX - DDSD_BackBuffer.lWidth)
End If
If Y + Anim_Size(AnimNum).SizeY > DDSD_BackBuffer.lHeight Then
rec.Bottom = rec.Bottom - (Y + Anim_Size(AnimNum).SizeY - DDSD_BackBuffer.lHeight)
End If
Just change the Anim_Size stuff to whatever the size of the surface is.