Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Speech bubble concern!


BugSICK
 Share

Recommended Posts

men, its hard.  :sad: i dont know what to do.

```
Sub Bltscriptbubble(ByVal Index As Long, ByVal MapNum As Long, ByVal X As Long, ByVal y As Long, ByVal Colour As Long)
    Dim TextX As Long
    Dim TextY As Long
    Dim intLoop As Integer
    Dim intLoop2 As Integer

    Dim bytLineCount As Byte
    Dim bytLineLength As Byte
    Dim strLine(0 To MAX_LINES - 1) As String
    Dim strWords() As String

    strWords() = Split(ScriptBubble(Index).Text, " ")

    If Len(ScriptBubble(Index).Text) < MAX_LINE_LENGTH Then
        DISPLAY_BUBBLE_WIDTH = 2 + ((Len(ScriptBubble(Index).Text) * 9) \ PIC_X)

        If DISPLAY_BUBBLE_WIDTH > MAX_BUBBLE_WIDTH Then
            DISPLAY_BUBBLE_WIDTH = MAX_BUBBLE_WIDTH
        End If
    Else
        DISPLAY_BUBBLE_WIDTH = 6
    End If

    ' TextX = X * PIC_X + Int(PIC_X) - ((DISPLAY_BUBBLE_WIDTH * 32) / 2) - 6
    TextX = X * PIC_X - 22
    TextY = y * PIC_Y - 22

    Call DD_BackBuffer.ReleaseDC(TexthDC)

    ' Draw the fancy box with tiles.
    Call BltTile2(TextX - 10, TextY - 10, 1)
    Call BltTile2(TextX + (DISPLAY_BUBBLE_WIDTH * PIC_X) - PIC_X - 10, TextY - 10, 2)

    For intLoop = 1 To (DISPLAY_BUBBLE_WIDTH - 2)
        Call BltTile2(TextX - 10 + (intLoop * PIC_X), TextY - 10, 16)
    Next intLoop

    TexthDC = DD_BackBuffer.GetDC

    ' Loop through all the words.
    For intLoop = 0 To UBound(strWords)
        ' Increment the line length.
        bytLineLength = bytLineLength + Len(strWords(intLoop)) + 1

        ' If we have room on the current line.
        If bytLineLength < MAX_LINE_LENGTH Then
            ' Add the text to the current line.
            strLine(bytLineCount) = strLine(bytLineCount) & strWords(intLoop) & " "
        Else
            bytLineCount = bytLineCount + 1

            If bytLineCount = MAX_LINES Then
                bytLineCount = bytLineCount - 1
                Exit For
            End If

            strLine(bytLineCount) = Trim$(strWords(intLoop)) & " "
            bytLineLength = 0
        End If
    Next intLoop

    Call DD_BackBuffer.ReleaseDC(TexthDC)

    If bytLineCount > 0 Then
        For intLoop = 6 To (bytLineCount - 2) * PIC_Y + 6
            Call BltTile2(TextX - 10, TextY - 10 + intLoop, 19)
            Call BltTile2(TextX - 10 + (DISPLAY_BUBBLE_WIDTH * PIC_X) - PIC_X, TextY - 10 + intLoop, 17)

            For intLoop2 = 1 To DISPLAY_BUBBLE_WIDTH - 2
                Call BltTile2(TextX - 10 + (intLoop2 * PIC_X), TextY + intLoop - 10, 5)
            Next intLoop2
        Next intLoop
    End If

    Call BltTile2(TextX - 10, TextY + (bytLineCount * 16) - 4, 3)
    Call BltTile2(TextX + (DISPLAY_BUBBLE_WIDTH * PIC_X) - PIC_X - 10, TextY + (bytLineCount * 16) - 4, 4)

    For intLoop = 1 To (DISPLAY_BUBBLE_WIDTH - 2)
        Call BltTile2(TextX - 10 + (intLoop * PIC_X), TextY + (bytLineCount * 16) - 4, 15)
    Next intLoop

    TexthDC = DD_BackBuffer.GetDC

    For intLoop = 0 To (MAX_LINES - 1)
        If strLine(intLoop) <> vbNullString Then
            Call DrawText(TexthDC, TextX + (((DISPLAY_BUBBLE_WIDTH) * PIC_X) / 2) - ((Len(strLine(intLoop)) * 8) \ 2) - 7, TextY, strLine(intLoop), QBColor(Colour))
            TextY = TextY + 16
        End If
    Next intLoop
End Sub
```
Link to comment
Share on other sites

just put it over the playername,

```
    If SpriteSize = 1 Then
        If Index = MyIndex Then
            If lvl >= 1 Then
                TextX = NewX + sx + Int(PIC_X / 2) - ((Len(GetPlayerName(MyIndex) & " lvl: " & GetPlayerLevel(Index)) / 2) * 8)
            Else
                TextX = NewX + sx + Int(PIC_X / 2) - ((Len(GetPlayerName(MyIndex)) / 2) * 8)
            End If

```
that is the coords to the playername, that might help
Link to comment
Share on other sites

@Warconn:

> hmm not sure, thats what i am saying, you gotta change like the name to be lower, and put the box over it, or something similar. Or you could copy what ever the emoticon location is, and use that…

Wouldn't that mixup some codes and what-not?
Link to comment
Share on other sites

Well messing with this throws a lot off actually. In Sylerean Online (closed unfortunatly), I found that if you moved shit around, it messes with positioning based on text length, same with names and the length. I never took the time to figure out a dynamic way to do it.
Link to comment
Share on other sites

@Crank:

> Well messing with this throws a lot off actually. In Sylerean Online (closed unfortunatly), I found that if you moved shit around, it messes with positioning based on text length, same with names and the length. I never took the time to figure out a dynamic way to do it.

did miguu screw this one up too?
Link to comment
Share on other sites

hey, i got it to work, now i dont have a proper bubble, its just blank, but here is what you change

```
    TextY = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - Int(PIC_Y) + 75

```
find that

then here is what you change it to

```
    TextY = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - Int(PIC_Y) - 50

```
Explaination

    TextY = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - Int(PIC_Y) -50

this is what you change to move it up and down, if it is negative, it is above the character, positive is below. I found that 50 is a pretty good number to set it as, i might move it though…

There you go, hope that helps
Warconn

let me know if this doesnt work, i tested it out, and it works fine for me…
Link to comment
Share on other sites

@Warconn:

> hey, i got it to work, now i dont have a proper bubble, its just blank, but here is what you change
>
> ```
>     TextY = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - Int(PIC_Y) + 75
>
> ```
> find that
>
> then here is what you change it to
>
> ```
>     TextY = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - Int(PIC_Y) - 50
>
> ```
> Explaination
>
>     TextY = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - Int(PIC_Y) -50
>
> this is what you change to move it up and down, if it is negative, it is above the character, positive is below. I found that 50 is a pretty good number to set it as, i might move it though…
>
> There you go, hope that helps
> Warconn
>
> let me know if this doesnt work, i tested it out, and it works fine for me…

Got a screenshot to show it?
Link to comment
Share on other sites

yea, ill have one in a little

[EDITS]

here is a screenshot of it working in NCO, this is also a preview of the human city, EriHaven ;)

![](http://dl.getdropbox.com/u/301475/ScreenShots/bubble.bmp)

i dont have a "bubble", but i just didnt like the GFX that came with it
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...