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

[EO] Chat on picScreen


telewizor
 Share

Recommended Posts

Hello, in this tutorial i will show you how to make chat as on this screen:
http://www.imagebanana.com/view/4dwnoj93/nowychat.png

So let's start:

Add new variables in modGlobals:
```
Public Linijka(0 To 4) As String
Public LinijkaCol(0 To 4) As Long
```
In mod DirectDraw7 above:
```
    For i = 1 To MAX_BYTE
        Call BltActionMsg(i)
    Next i
```
Add:
```
    For i = 0 To 4
        Call DrawChat(i)
    Next i
```
In modText above **Public Function BltMapAttributes()** add this:
```
Public Sub DrawChat(ByVal i As Byte)
Dim x, y As Long
x = Camera.Left + 4
y = Camera.Top + 445 + (i * 15)
    Call DrawText(TexthDC, x, y, Linijka(i), LinijkaCol(i)) 
End Sub
```
in modText too, find **Public Sub AddText** and in this Sub, under:
```
    frmMainGame.txtChat.SelStart = Len(frmMainGame.txtChat.text) - 1
```
Add:
```
    For i = 0 To 4
        If Linijka(i) = "" Then
            Linijka(i) = Msg
            LinijkaCol(i) = QBColor(color)
            i = 4
        Else
            If i = 4 Then
                Linijka(0) = Linijka(1)
                LinijkaCol(0) = LinijkaCol(1)
                Linijka(1) = Linijka(2)
                LinijkaCol(1) = LinijkaCol(2)
                Linijka(2) = Linijka(3)
                LinijkaCol(2) = LinijkaCol(3)
                Linijka(3) = Linijka(4)
                LinijkaCol(3) = LinijkaCol(4)
                Linijka(4) = Msg
                LinijkaCol(4) = QBColor(color)
            End If
        End If
    Next
```
Next, in modHandleData, find **Private Sub HandleSayMsg** and under **frmMainGame.txtChat.SelStart = Len(frmMainGame.txtChat.text) - 1**
Add:
```
    For i = 0 To 4
        If Linijka(i) = "" Then
            Linijka(i) = vbNewLine & Header & Name & ": " & message
            LinijkaCol(i) = colour
            i = 4
        Else
            If i = 4 Then
                Linijka(0) = Linijka(1)
                LinijkaCol(0) = LinijkaCol(1)
                Linijka(1) = Linijka(2)
                LinijkaCol(1) = LinijkaCol(2)
                Linijka(2) = Linijka(3)
                LinijkaCol(2) = LinijkaCol(3)
                Linijka(3) = Linijka(4)
                LinijkaCol(3) = LinijkaCol(4)
                Linijka(4) = vbNewLine & Header & Name & ": " & message
                LinijkaCol(4) = colour
            End If
        End If
    Next
```
That's all, i hope that this will working :D

'linijka' mean 'line' in polish

greetings

PS Sorry for my english ;)
Link to comment
Share on other sites

  • 3 months later...
@Connor:

> Mine doesn't have this part..
> ```
>     For i = 1 To MAX_BYTE
>         Call BltActionMsg(i)
>     Next i
>
> ```
> I've searched everywhere in modDirectDraw7.
> Any help? :)

What engine are you using? Use Ctrl+F and then check Current Project.
@Knuckles:

> i did but i still have the same mistake

Screenshot your source please.
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...