| Mirage Source http://web.miragesource.net/forums/ |
|
| Blting Something to the GameScreen http://web.miragesource.net/forums/viewtopic.php?f=201&t=3434 |
Page 1 of 1 |
| Author: | Becoming [ Fri Feb 29, 2008 6:48 pm ] |
| Post subject: | Blting Something to the GameScreen |
im trying to blt a graphic to a certain part of the gamescreen any idea how ? im not wanting it to follow the player, i just want it to be fixed at the location that the player was in. This is the code that is not working. rec.Top = 0 rec.Bottom = 64 rec.Left = 0 rec.Right = 32 Call AddText("Sub TestSub has been Fired", Green) x = PlantX '(GetPlayerX(Index) * PIC_X + sx + Player(Index).XOffset) - (NewPlayerX * PIC_X) - NewXOffset - 32 y = PlantY '(GetPlayerY(Index) * PIC_Y + sx + Player(Index).YOffset) - (NewPlayerY * PIC_Y) - NewYOffset - 35 Call DD_BackBuffer.BltFast(x - (NewPlayerX * PIC_X) + sx - NewXOffset, y - (NewPlayerY * PIC_Y) + sx - NewYOffset, DD_CorpseAnim, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) i commented out the other stuff because they are not moving. any ideas ? thanks. |
|
| Author: | William [ Wed Mar 12, 2008 6:31 pm ] |
| Post subject: | Re: Blting Something to the GameScreen |
If you check this code, you can easily edited it. Just rename it and run it like this: Code: call blttile1(2,2) That would put it at 1 position all the time. Of course you should remove the layers and just keep 1 Call DD_BackBuffer.BltFast for the thing you want to blit. Code: Public Sub BltTile(ByVal x As Long, ByVal y As Long)
'**************************************************************** '* WHEN WHO WHAT '* ---- --- ---- '* 07/12/2005 Shannara Optimized function. '**************************************************************** Dim Ground As Long Dim Anim1 As Long Dim Anim2 As Long With Map.Tile(x, y) Ground = .Ground Anim1 = .Mask Anim2 = .Anim End With ' Only used if ever want to switch to blt rather then bltfast With rec_pos .top = y * PIC_Y .Bottom = .top + PIC_Y .Left = x * PIC_X .Right = .Left + PIC_X End With With rec .top = Int(Ground / 7) * PIC_Y .Bottom = .top + PIC_Y .Left = (Ground - Int(Ground / 7) * 7) * PIC_X .Right = .Left + PIC_X End With Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT) If (MapAnim = 0) Or (Anim2 <= 0) Then ' Is there an animation tile to plot? If Anim1 > 0 And TempTile(x, y).DoorOpen = NO Then With rec .top = Int(Anim1 / 7) * PIC_Y .Bottom = .top + PIC_Y .Left = (Anim1 - Int(Anim1 / 7) * 7) * PIC_X .Right = .Left + PIC_X End With Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If Else ' Is there a second animation tile to plot? If Anim2 > 0 Then With rec .top = Int(Anim2 / 7) * PIC_Y .Bottom = .top + PIC_Y .Left = (Anim2 - Int(Anim2 / 7) * 7) * PIC_X .Right = .Left + PIC_X End With Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If End If End Sub |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|