Mirage Source
Blitting Stuff... - 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: Programming (https://mirage-engine.uk/forums/forumdisplay.php?fid=24)
+----- Forum: Visual Basic 6 (https://mirage-engine.uk/forums/forumdisplay.php?fid=32)
+----- Thread: Blitting Stuff... (/showthread.php?tid=2854)



Blitting Stuff... - Nean - 15-06-2009

Okay so I'm working on a way old source, dicking around. I made a /rest feature, where when you're resting you regen twice as much MP and HP, however you cannot move whatsoever or attack or cast spells, and you take twice the damage when you're resting. However now I need to get it to where an icon is drawn over the players character when they're resting.

I have this in the gameloop

Code:
If IsPlaying(I) Then
                    If GetPlayerMap(I) = GetPlayerMap(MyIndex) Then
                        If Player(I).IsResting = True Then
                            BltRestIcon I
                        End If
                    End If
                End If

Now I just need to know what to put in

Code:
Sub BltRestIcon()
                
                
End Sub

I've looked at the other drawing and whatnot, but it seemed to different to really help me out.


Re: Blitting Stuff... - GIAKEN - 15-06-2009

Easy stuff, yo.

Code:
Private Sub BltRestIcon(ByVal Index As Long)
Dim rec As DXVBLib.RECT

    With rec
        .Top = 0
        .Bottom = 32
        .Left = 0
        .Right = 32
    End With
    
    Call DD_BltFast(GetPlayerX(Index) * 32, (GetPlayerY(Index) * 32) - 32, DDS_RestIcon, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
    
End Sub

Then call this somewhere:

Code:
Call InitDDSurf("resticon", DDS_RestIcon)

And make sure you have a resticon.bmp.

The rec defines the size of the image...for example the rec I have set up does a 32x32 selection from the resticon.bmp at 0,0 (very top left).


Re: Blitting Stuff... - Egon - 15-06-2009

Can't you just rip the emotion bubble code and change it around so they don't disappear? That's how I'd do it anyway.


Re: Blitting Stuff... - GIAKEN - 15-06-2009

There isn't emoticon code in MS4.


Re: Blitting Stuff... - Nean - 15-06-2009

I was using an Old ED source though. However you both helped me immensely, thanks. Smile Both examples helped me get it.


Re: Blitting Stuff... - GIAKEN - 15-06-2009

OH YEAH I forgot it's for HO which is old ED...alright my bad Big Grin


Re: Blitting Stuff... - Nean - 15-06-2009

Here's what I have:

Code:
Private Sub BltRestIcon(ByVal Index As Long)
    Dim rec As DXVBLib.RECT
    Dim X2 As Long
    Dim Y2 As Long
    X2 = NewX + sx + 0

    If GetPlayerGuild(Index)  vbNullString Then
        Y2 = NewY + sx - 42
    Else
        Y2 = NewY + sx - 30
    End If

    With rec
        .Top = 0
        .Bottom = 32
        .Left = 0
        .Right = 32
    End With
  
    Call DD_BackBuffer.BltFast(X2, Y2, DD_RestIcon, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
  
End Sub

Does this look good? Seems to display right for me, but will it display right for everyone?


Re: Blitting Stuff... - GIAKEN - 15-06-2009

Need to use GetPlayerX and Y in there...look at other code like spells or something.


Re: Blitting Stuff... - Nean - 16-06-2009

Yeah, I got it fixed. Smile