Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Blitting Stuff...
#1
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.
Reply
#2
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).
Reply
#3
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.
Reply
#4
There isn't emoticon code in MS4.
Reply
#5
I was using an Old ED source though. However you both helped me immensely, thanks. Smile Both examples helped me get it.
Reply
#6
OH YEAH I forgot it's for HO which is old ED...alright my bad Big Grin
Reply
#7
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?
Reply
#8
Need to use GetPlayerX and Y in there...look at other code like spells or something.
Reply
#9
Yeah, I got it fixed. Smile

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)