Aldeia RPG

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Suporte ao desenvolvimento de jogos


3 participantes

    Alinhar nick

    Motodark
    Motodark
    Ocasional
    Ocasional


    Mensagens : 169
    Créditos : 5

    Alinhar nick Empty Alinhar nick

    Mensagem por Motodark Ter Fev 03, 2015 1:00 am

    porque quando eu uso uma sprite maior meu nick fica lá na casa do caralho e a guild é titulo fica certinho
    Dooolly
    Dooolly
    Colaborador
    Colaborador


    Medalhas : Alinhar nick Trophy12
    Mensagens : 1227
    Créditos : 153

    Ficha do personagem
    Nível: 1
    Experiência:
    Alinhar nick Left_bar_bleue0/0Alinhar nick Empty_bar_bleue  (0/0)
    Vida:
    Alinhar nick Left_bar_bleue30/30Alinhar nick Empty_bar_bleue  (30/30)

    Alinhar nick Empty Re: Alinhar nick

    Mensagem por Dooolly Ter Fev 03, 2015 11:16 am

    Helling escreveu:porque quando eu uso uma sprite maior meu nick fica lá na casa do caralho e a guild é titulo fica certinho

    mostrar uma screen ai, e botar a sub drawplayername para eu dar uma olhadinha.
    avatar
    gui408
    Ocasional
    Ocasional


    Mensagens : 227
    Créditos : 10

    Alinhar nick Empty Re: Alinhar nick

    Mensagem por gui408 Ter Fev 03, 2015 1:09 pm

    Sao As Base Sprites,se sua spriter tiver um branco maior acima da base sprite o nome fik acima do fundo branco,se vc alinhou com uma base sprite,se a base for diferente,vai fik assim mesmo.
    Motodark
    Motodark
    Ocasional
    Ocasional


    Mensagens : 169
    Créditos : 5

    Alinhar nick Empty Re: Alinhar nick

    Mensagem por Motodark Ter Fev 03, 2015 6:08 pm

    Alinhar nick <img src=" />          Alinhar nick <img src=" />




    Código:



    Public Sub DrawPlayerName(ByVal Index As Long)


    Dim TextX As Long


    Dim TextY As Long


    Dim color As Long


    Dim Name As String


    Dim Text2X As Long


    Dim Text2Y As Long


    Dim GuildString As String








        ' If debug mode, handle error then exit out


        If Options.Debug = 1 Then On Error GoTo errorhandler





        ' Check access level


        If GetPlayerPK(Index) = NO Then





            Select Case GetPlayerAccess(Index)


                Case 0


                    color = QBColor(BrightGreen)


                Case 1


                    color = QBColor(DarkGrey)


                Case 2


                    color = QBColor(Cyan)


                Case 3


                    color = QBColor(BrightGreen)


                Case 4


                    color = QBColor(Yellow)


                    End Select


            Else


                  color = QBColor(BrightRed)


        End If





        Name = Trim$(Player(Index).Name)


        


         


            ' calc pos


        TextX = ConvertMapX(GetPlayerX(Index) * PIC_X / 1) + Player(Index).XOffset + (PIC_X / 2) - getWidth(TexthDC, (Trim$(Name)))


        GuildString = Player(Index).GuildName


        Text2X = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X / 2) - getWidth(TexthDC, (Trim$(GuildString)))


        If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then


        TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16


        Text2Y = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16


        Else


       


       ' Determine location for text


       TextX = ConvertMapX(GetPlayerX(Index) * PIC_X / 1) + Player(Index).XOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 10


        TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 13


        Text2Y = ConvertMapY(GetPlayerY(Index) * PIC_Y / 1) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 3) + 2


        End If








        ' Draw name


        Call DrawText(TexthDC, TextX, TextY, "Lv." & GetPlayerLevel(Index) & ": " & GetPlayerName(Index), color)


        If Not Player(Index).GuildName = vbNullString Then


         Call DrawText(TexthDC, Text2X, Text2Y, GuildString, QBColor(BrightCyan))


        End If





        


        ' Error handler


        Exit Sub


    errorhandler:


        HandleError "DrawPlayerName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext


        Err.Clear


        Exit Sub


    End Sub
    Dooolly
    Dooolly
    Colaborador
    Colaborador


    Medalhas : Alinhar nick Trophy12
    Mensagens : 1227
    Créditos : 153

    Ficha do personagem
    Nível: 1
    Experiência:
    Alinhar nick Left_bar_bleue0/0Alinhar nick Empty_bar_bleue  (0/0)
    Vida:
    Alinhar nick Left_bar_bleue30/30Alinhar nick Empty_bar_bleue  (30/30)

    Alinhar nick Empty Re: Alinhar nick

    Mensagem por Dooolly Ter Fev 03, 2015 11:24 pm

    o problema é que vc botou para mostrar o level na mesma linha que o nome
    o codigo só está alinhando o nome o level não, isso deixa a linha desalinhada...

    Dei uma modificada na sub, não testei fiz aqui no comentário mesmo, mais acho que vai dar certo:
    Código:
    Public Sub DrawPlayerName(ByVal Index As Long)
    Dim TextX As Long
    Dim TextY As Long
    Dim color As Long
    Dim Name As String, Level as string
    Dim Text2X As Long
    Dim Text2Y As Long
    Dim GuildString As String

        ' If debug mode, handle error then exit out
        If Options.Debug = 1 Then On Error GoTo errorhandler

        ' Check access level
        If GetPlayerPK(Index) = NO Then
            Select Case GetPlayerAccess(Index)
                Case 0
                    color = QBColor(BrightGreen)
                Case 1
                    color = QBColor(DarkGrey)
                Case 2
                    color = QBColor(Cyan)
                Case 3
                    color = QBColor(BrightGreen)
                Case 4
                    color = QBColor(Yellow)
             End Select
            Else
              color = QBColor(BrightRed)
        End If

        Name = Trim$(Player(Index).Name)
        Level = "Lv. " & Trim$(Getplayerlevel(index) & ": "

        ' calc pos

        TextX = ConvertMapX(GetPlayerX(Index) * PIC_X / 1) + Player(Index).XOffset + (PIC_X / 2) - getWidth(TexthDC, (Trim$(Level & Name)))

        GuildString = Player(Index).GuildName

        Text2X = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X / 2) - getWidth(TexthDC, (Trim$(GuildString)))

        If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
         TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16
         Text2Y = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16
        Else
          ' Determine location for text
          TextX = ConvertMapX(GetPlayerX(Index) * PIC_X / 1) + Player(Index).XOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 10
          TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 13

        Text2Y = ConvertMapY(GetPlayerY(Index) * PIC_Y / 1) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 3) + 2
        End If

        ' Draw name
        Call DrawText(TexthDC, TextX, TextY, Level & name, color)

        If Not Player(Index).GuildName = vbNullString Then
          Call DrawText(TexthDC, Text2X, Text2Y, GuildString, QBColor(BrightCyan))
        End If

        ' Error handler
        Exit Sub
    errorhandler:
        HandleError "DrawPlayerName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext
        Err.Clear
        Exit Sub
    End Sub
    Motodark
    Motodark
    Ocasional
    Ocasional


    Mensagens : 169
    Créditos : 5

    Alinhar nick Empty Re: Alinhar nick

    Mensagem por Motodark Ter Fev 03, 2015 11:57 pm

    Ai deu certo, muito obrigado +1 cred para kd um de vocês que me ajudaram.

    Conteúdo patrocinado


    Alinhar nick Empty Re: Alinhar nick

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Sex Jul 26, 2024 10:34 pm