Post

 Resources 

Console


Clipping problems.. Warder (7 replies, 0 views) (2000-Jul-4)
-
** I hate it when the web board erases your message grrrr** So this is a repost.. Ive tried using Directdraw clipper, but that doesnt work, I even tried using lucky's clipping, voodoovb cliipping, and, I think robs (cant remember his real name) clipping, none works, so this is my last resort here.... I'll post my code here, and see if you guys can figure out whats wrong. The bottom and right clipping works, however the top and left clipping wont work at all. It just makes the graphics disappear. Private Sub GetRect(bytTileNumber As Byte, ByRef intTileX As Integer, ByRef intTileY As Integer, ByRef rectTile As RECT) Dim i As Integer If bytTileNumber <> 0 Then 'Me.Caption = GfxData(bytTileNumber).pixelWidth With rectTile '.Left = 0 .Left = GfxData(bytTileNumber).sX .Right = GfxData(bytTileNumber).sX + GfxData(bytTileNumber).pixelWidth '.Right = .Left & GfxData(bytTileNumber).pixelWidth '.Top = 64 .Top = GfxData(bytTileNumber).sY '.Bottom = .Top + TILE_HEIGHT .Bottom = .Top + GfxData(bytTileNumber).pixelHeight 'GfxData(bytTileNumber).pixelHeight 'Clip rect 'If this tile is off the right side of the screen... If intTileX + GfxData(bytTileNumber).pixelWidth > SCREEN_WIDTH Then .Right = .Right + (SCREEN_WIDTH - (intTileX + GfxData(bytTileNumber).pixelWidth)) 'If this tile is off the bottom of the screen... If intTileY + GfxData(bytTileNumber).pixelHeight > SCREEN_HEIGHT Then .Bottom = .Bottom + (SCREEN_HEIGHT - (intTileY + GfxData(bytTileNumber).pixelHeight)) 'If this tile is off the left side of the screen... 'If intTileX < 0 Then ' .Left = .Left + (intTileX + GfxData(bytTileNumber).sX) ' (intTileX * 32) '.Right = GfxData(bytTileNumber).sX + GfxData(bytTileNumber).pixelWidth - intTileX ' intTileX = 0 'End If If intTileX < 0 Then i = 0 - intTileX intTileX = intTileX + i .Left = .Left + i End If 'If this tile is off the top of the screen... If intTileY < 0 Then .Top = .Top - intTileY intTileY = 0 End If 'If this tile is off the right side of the screen... 'If intTileX + GfxData(bytTileNumber).pixelWidth > SCREEN_WIDTH Then .Right = .Right + (SCREEN_WIDTH - (intTileX + GfxData(bytTileNumber).pixelWidth)) 'If this tile is off the bottom of the screen... 'If intTileY + GfxData(bytTileNumber).pixelHeight > SCREEN_HEIGHT Then .Bottom = .Bottom + (SCREEN_HEIGHT - (intTileY + GfxData(bytTileNumber).pixelHeight)) 'If this tile is off the right side of the screen... ' If intTileX + 32 > SCREEN_WIDTH Then .Right = .Right + (SCREEN_WIDTH - (intTileX + 32)) 'If this tile is off the bottom of the screen... ' If intTileY + 32 > SCREEN_HEIGHT Then .Bottom = .Bottom + (SCREEN_HEIGHT - (intTileY + 32)) End With End If End Sub As you might be able to see, there is no set tile width, since each "tile", which includes houses and trees, are different height and width... offset is 0. This is based off of Lucky's TileScroll sample, but he couldnt help so...


-
Back to Forum

RE: Clipping problems.. Peter (6 replies) (2000-Jul-4)
Here's my modification... Warder (5 replies) (2000-Jul-4)
That tiling code Peter (0 replies) (2000-Jul-4)
RE: Here's my modification... Jay Wheeler (3 replies) (2000-Jul-6)
I already changed the res, it makes no difference Warder (2 replies) (2000-Jul-6)
RE: I already changed the res, it makes no differe Jay Wheeler (1 reply) (2000-Jul-7)
Clipping DLL... The Gilb (0 replies) (2000-Jul-7)

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.
There have been 184 visitors within the last 20 minutes
RSS News Feed