Mirage Source
picScreen or map question - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: picScreen or map question (/showthread.php?tid=574)



picScreen or map question - halla - 03-01-2007

Ok I pretty much got alpha blending working.. I got 2 pixboxes that will blend together. I want to now have it do it with the picScreen... or the map.

Code:
Private Sub hsAlphaBlend_Change()
'    picTest.Picture = picChat.Picture
    
    With BF
        .BlendOp = AC_SRC_OVER
        .BlendFlags = 0
        .SourceConstantAlpha = 155
        .AlphaFormat = 0
    End With

    RtlMoveMemory lBF, BF, 4
    
    AlphaBlend picMainMenu.hdc, 0, 0, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, picScreen.hdc, 0, 0, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, lBF

'   picTest.Refresh
End Sub

Thats what I have. Some reason with this .. say if I have a browser up when I start the game.. my main menu is blended with the browser... I dont get why.

What do I use to mix it with the screen.... is using picScreen wrong?


- Tony - 03-01-2007

Grr dunno 0.0.. My alpha blending is almost working. It blends but it shows for only 1 millisecond. Waiting for someones help T.T

SAVE ME

Glimpse of the blending
[Image: AlphaGlimpse.png]

:: Pando


- Gilgamesch - 03-01-2007

Pando Wrote:Grr dunno 0.0.. My alpha blending is almost working. It blends but it shows for only 1 millisecond. Waiting for someones help T.T

SAVE ME

Glimpse of the blending
[Image: AlphaGlimpse.png]

:: Pando


did you put the code in the gameloop?


- Tony - 03-01-2007

Gilgamesch Wrote:
Pando Wrote:Grr dunno 0.0.. My alpha blending is almost working. It blends but it shows for only 1 millisecond. Waiting for someones help T.T

SAVE ME

Glimpse of the blending
[Image: AlphaGlimpse.png]

:: Pando


did you put the code in the gameloop?

Tried but it flickers.


- halla - 03-01-2007

Get in contact with me... maybe if we mix some of what we both have we can get it...


- William - 03-01-2007

what are you going to do?


- halla - 03-01-2007

William Wrote:what are you going to do?

What do you mean?

Heres a picture of my problem guys. It seems its copying from the computer screen not the picScreen lol...

[Image: AB.gif]


- William - 03-01-2007

What are you going to use it for? rain effect?


- halla - 03-01-2007

No its for semi transparent menus. Like big time games have. Its so they can be on the screen but not completely cover it.

I just tried something else and almost got it... I might be close Smile lol


- William - 03-01-2007

okay didn't check the code. just thought the pic was cool Tongue


- halla - 03-01-2007

I got it working now. I just have to have it update when I move it... it still shows the background of wher eit was.


- William - 03-01-2007

Screenshot please Smile


- halla - 03-01-2007

Ok now I got it when you move it it shows something different but its still not what your right over.. I dont see why its not...

Code:
Private Sub hsAlphaBlend_Change()
    picMainMenu.Picture = picMainMenu.Picture
    
    With BF
        .BlendOp = AC_SRC_OVER
        .BlendFlags = 0
        .SourceConstantAlpha = 75
        .AlphaFormat = 0
    End With

    RtlMoveMemory lBF, BF, 4
    
    AlphaBlend picMainMenu.hdc, 0, 0, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, picScreen.hdc, picMainMenu.top, picMainMenu.Left, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, lBF

    picMainMenu.Refresh
End Sub

I updated the picture above. Its how I have it now.


- Gilgamesch - 03-01-2007

put something in the gameloop so its being refreshed all the time

it somehow safes whats behin dit the first time its being shown, so it needs to be refreshed


- halla - 03-01-2007

Well I changed 0 and 0 which determine where to start to take the picture from...

to the Top and Left values of the Menu. I figured then it would start on picScreen there and take whats right below it. It does make it so when I move it changes but its not whats right below it.


- halla - 04-01-2007

Ok my problem is just with this.

Code:
AlphaBlend frmMirage.picMainMenu.hdc, 0, 0, frmMirage.picMainMenu.ScaleWidth, frmMirage.picMainMenu.ScaleHeight, frmMirage.picScreen.hdc, frmMirage.picMainMenu.top, frmMirage.picMainMenu.Left, frmMirage.picMainMenu.ScaleWidth, frmMirage.picMainMenu.ScaleHeight, lBF

Dont I want to use Top and Left here? That gets where the start of the menu is so it can get that part of the picScreen right? Well its all off. When I move the menu up it moves over and vice versa. I figured ok then I got Top and Left mixed up. Well when I change them it doesnt alpha blend at all.

Is there something I should use instead of Top and Left? Also When the menu is near the character it does something weird. It shows the menu inside it not blended and that menu is where it should be by the character.. how the other should be. If you want a picture that explains it better.

Anyways I have it working if I can just get the positioning right.


- halla - 05-01-2007

Ok I just about got it. I tried a 3rd surface to blt them too and it works fine... but of course I dont want an extra one.

The way I have it with 2 works but the thing is... some reason it shows the menu on the picscreen also so when it moves it stays solid cause its the alphablended over top of the solid one always.

THe thing I need to do is some how have it so the menu isnt on the picscreen... then it will just show the alphablended one. Anyone know how to go about this?

Code:
Private Sub hsAlphaBlend_Change()
    picMainMenu.Picture = picMainMenu.Picture
    
    With BF
        .BlendOp = AC_SRC_OVER
        .BlendFlags = 0
        .SourceConstantAlpha = 75
        .AlphaFormat = 0
    End With

    RtlMoveMemory lBF, BF, 4
    
    AlphaBlend picMainMenu.hdc, 0, 0, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, picScreen.hdc, picMainMenu.Left, picMainMenu.top, picMainMenu.ScaleWidth, picMainMenu.ScaleHeight, lBF
    
    picMainMenu.Refresh
End Sub