|
-
May 9th, 2002, 01:45 PM
#1
Thread Starter
Lively Member
Whats the matter with....
Code:
Public Sub LoadSprite(ByRef Sprite As DirectDrawSurface7, File As String, bWidth As Integer, bHeight As Integer, ColourKey As Integer)
Dim CKey As DDCOLORKEY
Dim ddsdNewSprite As DDSURFACEDESC2
'This routine loads sprites in the FObject file and sets their colour keys
ddsdNewSprite.lFlags = DDSD_CAPS Or DDSD_WIDTH Or DDSD_HEIGHT 'Set the surface description to include the Capabilities, Width and Height
ddsdNewSprite.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN 'Set the surface's capabilities to be an offscreen surface
ddsdNewSprite.lWidth = bWidth 'Set the width of the surface
ddsdNewSprite.lHeight = bHeight 'Set the height of the surface
THIS? -> Set Sprite = dd.CreateSurfaceFromResource("", File, ddsdNewSprite) 'Load the bitmap from the resource file into the surface using the surface description
CKey.low = ColourKey 'Set the low value of the colour key
CKey.high = ColourKey 'and the high value (in this case they're the same because we're not using a range)
Sprite.SetColorKey DDCKEY_SRCBLT, CKey 'Set the sprites colourkey using the key just created
End Sub
Thanks
Last edited by LBS; May 9th, 2002 at 01:49 PM.
-
May 9th, 2002, 02:13 PM
#2
-
May 9th, 2002, 02:40 PM
#3
Thread Starter
Lively Member
-
May 9th, 2002, 04:50 PM
#4
Fanatic Member
Automation error
These automation errors can come up even if there isn't really a error! that error gets me often! i hate it!!!
HATE AUTOMATION ERROR!
But, i think the error has something to do with that line...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|