Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
blting to picscreen with seamless maps
#1
Well it seems.. My blting of the NPC Names, Player Names, NPC HP Bars, and Player HP&MP Bars have stopped working... This is the tutorial I added.
http://www.sylphonline.com/enginefiles/M...0Maps.html

Here are the sub's for those certain things..

BltPlayerName
[spoiler]
Code:
Sub BltPlayerName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim Color As Long
    
    ' Check access level
    If GetPlayerPK(Index) = NO Then
        Select Case GetPlayerAccess(Index)
            Case 0
                Color = QBColor(Brown)
            Case 1
                Color = QBColor(DarkGrey)
            Case 2
                Color = QBColor(Cyan)
            Case 3
                Color = QBColor(Blue)
            Case 4
                Color = QBColor(Pink)
        End Select
    Else
        Color = QBColor(BrightRed)
    End If
    
    ' Draw name
    TextX = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + Int(PIC_X / 2) - ((Len(GetPlayerName(Index)) / 2) * 8)
    TextY = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - 50 '(or-4 -  pic_y - pic_y/2)
    TextX = TextX + (PIC_X * (MAX_MAPX + 1))
    TextY = TextY + (PIC_Y * (MAX_MAPY + 1))
    Call DrawText(TexthDC, TextX, TextY, GetPlayerName(Index), Color)
End Sub
[/spoiler]

BltNPCBars
[spoiler]
Code:
Sub BltNpcBars(ByVal Index As Long)
Dim x As Long, y As Long
x = MapNpc(Index).x * PIC_X + MapNpc(Index).XOffset
y = MapNpc(Index).y * PIC_Y + MapNpc(Index).YOffset - 4
If MapNpc(Index).HP = 0 Then Exit Sub
Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0))
Call DD_BackBuffer.DrawBox(x, y + 32, x + 32, y + 36)
Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0))
Call DD_BackBuffer.DrawBox(x, y + 32, x + ((MapNpc(Index).HP / 100) / (MapNpc(Index).MaxHP / 100) * 32), y + 36)
End Sub
[/spoiler]

BltMapNPCName
[spoiler]
Code:
Sub BltMapNPCName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long

    If MapNpc(Index).x = CurX And MapNpc(Index).y = CurY Then
        With Npc(MapNpc(Index).Num)
            'Draw name
            TextX = MapNpc(Index).x * PIC_X + MapNpc(Index).XOffset + CLng(PIC_X / 2) - ((Len(Trim$(.name)) / 2) * 8)
            TextY = MapNpc(Index).y * 32 + MapNpc(Index).YOffset - CLng(PIC_Y / 2) - 4
            TextX = TextX + (PIC_X * (MAX_MAPX + 1))
            TextY = TextY + (PIC_Y * (MAX_MAPY + 1))
        DrawText TexthDC, TextX, TextY, Trim$(.name), vbWhite
        End With
    End If
End Sub
[/spoiler]

BltPlayerBars
[spoiler]
Code:
Sub BltPlayerBars(ByVal Index As Long)
Dim x As Long, y As Long
x = GetPlayerX(Index) * PIC_X + Player(Index).XOffset
y = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - 4
If Player(Index).HP = 0 Then Exit Sub

Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0))
Call DD_BackBuffer.DrawBox(x, y + 32, x + 32, y + 36)

Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0))
Call DD_BackBuffer.DrawBox(x, y + 32, x + ((Player(Index).HP / 100) / (Player(Index).MaxHP / 100) * 32), y + 36)

If Index = MyIndex Then
Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0))
Call DD_BackBuffer.DrawBox(x, y + 35, x + 32, y + 39)

'draws MP for you
Call DD_BackBuffer.SetFillColor(RGB(0, 0, 255))
Call DD_BackBuffer.DrawBox(x, y + 35, x + ((Player(MyIndex).MP / 100) / (Player(MyIndex).MaxMP / 100) * 32), y + 39)
End If
End Sub
[/spoiler]

Any Ideas? Help would be highly appreciated. Thanks!
Reply
#2
Helps to know which tut you used. Verrigan or Misunderstood's?
Reply
#3
Perfekt Wrote:Helps to know which tut you used. Verrigan or Misunderstood's?
The links is in my post,I belive Sync wrote it?
Reply
#4
Shann didn't write it. Verrigan wrote the original. That's Misunderstood's version.
Reply
#5
Perfekt Wrote:Shann didn't write it. Verrigan wrote the original. That's Misunderstood's version.

Oh, Well, thats the one im having trouble with..
Reply
#6
You have to pass the mapxoffset and mapyoffset to each of those. It's in the tut.
Reply
#7
Perfekt Wrote:You have to pass the mapxoffset and mapyoffset to each of those. It's in the tut.

You just confused me even more.. >.
Reply
#8
That's something basic with the system. If you can't understand that, then this is a bit too hard for you it seems.

The tut has everything you need. Anything left out, is basic.

Passing it off means doing it the way he had you set up the bltplayer and bltnpc subs.
Reply
#9
Ok So I though about what you said and read over the bltplayername sub, I then thought about the rollover name tut. I added, I commented out, If Player(I).x = CurX And Player(I).y = CurY Then, and the names blted to the screen. Oh Yay!

But. I really want the rollover names... Really... So would anyone have an Idea of how to make it work? Again here's the code from the bltplayer If Statement in GameLoop.

Code:
If Player(I).x = CurX And Player(I).y = CurY Then
Reply
#10
I tried the rollover names before, but gave up cause I didn't feel like messing with it. I'm sure it can't be too hard. Verrigan is currently revamping FPO heavily so I can't try anything.

Sorry.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)