Mirage Source http://www.miragesource.net/forums/ |
|
Transparent Color For Surfaces http://www.miragesource.net/forums/viewtopic.php?f=210&t=932 |
Page 1 of 1 |
Author: | Tutorial Bot [ Sat Dec 23, 2006 10:01 pm ] |
Post subject: | Transparent Color For Surfaces |
Author: Enigmewave Difficulty: 3/5 :: CLIENT SIDE :: In modDirectX.bas, add: Code: Public Sub SetMaskColorFromPixel(ByRef TheSurface As DirectDrawSurface7, ByVal X As Long, ByVal Y As Long) Dim TmpR As RECT Dim TmpDDSD As DDSURFACEDESC2 Dim TmpColorKey As DDCOLORKEY With TmpR .Left = X .Top = Y .Right = X .Bottom = Y End With TheSurface.Lock TmpR, TmpDDSD, DDLOCK_WAIT Or DDLOCK_READONLY, 0 With TmpColorKey .low = TheSurface.GetLockedPixel(X, Y) .high = .low End With TheSurface.SetColorKey DDCKEY_SRCBLT, TmpColorKey TheSurface.Unlock TmpR End Sub In sub InitSurfaces, replace: Code: DD_SpriteSurf.SetColorKey DDCKEY_SRCBLT, key With: Code: SetMaskColorFromPixel DD_SpriteSurf, 0, 0 Replace: Code: DD_TileSurf.SetColorKey DDCKEY_SRCBLT, key With: Code: SetMaskColorFromPixel DD_TileSurf, 0, 0 Replace: Code: DD_ItemSurf.SetColorKey DDCKEY_SRCBLT, key With: Code: SetMaskColorFromPixel DD_ItemSurf, 0, 0 After that, whatever color the top left pixel is on the sprites surface, tiles surface, or items surface will be the transparent color for that surface. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |