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

Word Wrapping Problem


hisherwin
 Share

Recommended Posts

I was trying to create a Text Wrapping and it was drawn on screen

I followed the tutorial here on forum but it doesn't work clearly :D the arrangement of the text are not good

```
Public Sub DrawChat()
Dim x As Long
Dim y As Long
Dim Wrap As Long
Dim Text As String
Dim SubString As String
Dim ChatArray() As String

    x = 0
    Text = SubText
    y = 1
    ChatArray = Split(Text, " ")

    Do While Len(Text) > 50
        If y = 1 Then
            Wrap = Len(Text) Mod 50
        Else
            Wrap = 50
        End If

        If UBound(ChatArray) > 0 Then
            Do Until Asc(Mid$(Text, Len(Text) - Wrap, 1)) = 32 'break line on spaces only.
                Wrap = Wrap + 1
            Loop
        ElseIf UBound(ChatArray) <= 0 Then
            Exit Do
            Wrap = 1
        End If

        SubString = Right$(Text, Wrap)

        Call DrawText(TexthDC, 75, 365 + (x * 20), SubString, RGB(255, 255, 255))

        Text = Left$(Text, Len(Text) - Wrap)

        x = x + 1
        y = y + 1
    Loop

    Call DrawText(TexthDC, 75, 365 + (x * 20), Text, RGB(255, 255, 255))
End Sub

```
Check on this client

[http://eclipseorigins.com/community/filehost/e9dc0ab81d491e8c72ae3eaa80ade29c.zip](http://eclipseorigins.com/community/filehost/e9dc0ab81d491e8c72ae3eaa80ade29c.zip)

Open Client -> Click Continue -> Click Send 

The wrap text appear at the top , i want it to appear at the bottom ,, anyone can do something about it?

thanks in advance
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...