Results 1 to 4 of 4

Thread: Whats the matter with....

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    93

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width