evilbunnie Posted March 27, 2011 Author Share Posted March 27, 2011 **Chat drawn onto the screen!****Hey, I haven't made a tutorial in very long, but i figured i'd put one out, yes this is a very simple system, but some people want it.You can adjust where the chat is drawn in the "DrawChat" sub.![](http://www.freemmorpgmaker.com/files/imagehost/pics/817a0cfe99ea48bce5ba0244df58281a.png)First, open the client and add at the very bottom of "modText":**```'Evilbunnie's DrawnChat systemPublic Sub DrawChat()Dim i As Integer  For i = 1 To 6    Call DrawText(TexthDC, Camera.left + 10, (Camera.Bottom - 20) - (i * 20), Chat(i).text, Chat(i).Colour)  NextEnd Sub'Evilbunnie's DrawChat systemPublic Sub ReOrderChat(ByVal nText As String, nColour As Long)Dim i As Integer  For i = 19 To 1 Step -1    Chat(i + 1).text = Chat(i).text    Chat(i + 1).Colour = Chat(i).Colour  Next  Chat(1).text = nText  Chat(1).Colour = nColourEnd Sub```**Then replace the sub "AddText" with:**```Public Sub AddText(ByVal Msg As String, ByVal color As Integer)Dim S As String  ' If debug mode, handle error then exit out  If Options.Debug = 1 Then On Error GoTo errorhandler  S = vbNewLine & Msg  frmMain.txtChat.SelStart = Len(frmMain.txtChat.Text)  frmMain.txtChat.SelColor = QBColor(color)  frmMain.txtChat.SelText = S  frmMain.txtChat.SelStart = Len(frmMain.txtChat.Text) - 1  'Evilbunnie's DrawnChat System  ReOrderChat Msg, QBColor(color)  ' Error handler  Exit Suberrorhandler:  HandleError "AddText", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext  Err.Clear  Exit SubEnd Sub```**Then in "HandleSayMsg" under:**```frmMain.txtChat.SelStart = Len(frmMain.txtChat.Text) - 1```**Add:**```ReOrderChat Header & Name & ": " & message, Colour```**Then in "modTypes" under:**```Public Options As OptionsRec```**Add:**```'Evilbunnie's DrawnChat systemPublic Chat(1 To 20) As ChatRec'Evilbunnie's DrawnChat systemPrivate Type ChatRec  text As String  Colour As LongEnd Type```**In Sub "Render_Graphics" above:**```' draw fps ```**Add:**```'Evilbunnie's DrawnChat SystemDrawChat```**Tested on EO1.2 - 2.0**-Thanks evilbunnie Link to comment Share on other sites More sharing options...
Robin Posted March 27, 2011 Share Posted March 27, 2011 Why would you go to all the effort of caching the messages as they come in then render them line by line draining your FPS?Pre-render the chat to a surface and render that instead. Link to comment Share on other sites More sharing options...
evilbunnie Posted March 27, 2011 Author Share Posted March 27, 2011 @Robin:> Why would you go to all the effort of caching the messages as they come in then render them line by line draining your FPS?> > Pre-render the chat to a surface and render that instead.Oh yeah, never thought of that, thanks robin.Will update now. Link to comment Share on other sites More sharing options...
lutzyfer03 Posted March 28, 2011 Share Posted March 28, 2011 thanks for sharing this Link to comment Share on other sites More sharing options...
Craselin Posted March 31, 2011 Share Posted March 31, 2011 heh, sorry about being suck a newb but what does this do exactly :S Link to comment Share on other sites More sharing options...
Robin Posted March 31, 2011 Share Posted March 31, 2011 @Craselin:> heh, sorry about being suck a newb but what does this do exactly :S… exactly what it shows in the screenshot. Link to comment Share on other sites More sharing options...
Craselin Posted April 2, 2011 Share Posted April 2, 2011 @Robin:> … exactly what it shows in the screenshot.i didn't have the screenshot when I first saw it (i don't think) Link to comment Share on other sites More sharing options...
evilbunnie Posted April 2, 2011 Author Share Posted April 2, 2011 @Craselin:> i didn't have the screenshot when I first saw it (i don't think)It's always been there! Link to comment Share on other sites More sharing options...
Craselin Posted April 2, 2011 Share Posted April 2, 2011 Lol, ok in that case, my bad Link to comment Share on other sites More sharing options...
Carim123 Posted April 13, 2011 Share Posted April 13, 2011 Thought I'd report this; When you chat any longer than the picScreen, instead of going over the line, it just carries on, off-screen. Link to comment Share on other sites More sharing options...
evilbunnie Posted April 13, 2011 Author Share Posted April 13, 2011 @QWERTYUIoP:> Thought I'd report this; When you chat any longer than the picScreen, instead of going over the line, it just carries on, off-screen.Well then set a limit to how much you can type. Link to comment Share on other sites More sharing options...
Yxxe Posted April 13, 2011 Share Posted April 13, 2011 @Captain:> Well then set a limit to how much you can type.Or wrap the text. Link to comment Share on other sites More sharing options...
shado360 Posted April 13, 2011 Share Posted April 13, 2011 How would one go about doing that, may I ask? ;) Link to comment Share on other sites More sharing options...
Yxxe Posted April 13, 2011 Share Posted April 13, 2011 @Païn:> How would one go about doing that, may I ask? ;)Split the text at a certain character length (or get the width of the string) then place the remainder of the text on the next line, also checking whether that can be split. Link to comment Share on other sites More sharing options...
Carim123 Posted April 13, 2011 Share Posted April 13, 2011 Never mind, I figured it out. Link to comment Share on other sites More sharing options...
gdog12356 Posted April 24, 2011 Share Posted April 24, 2011 i get an error for variable not defined```ReOrderChat Header & Name & ": " & message, colour``` Link to comment Share on other sites More sharing options...
adr990 Posted May 23, 2011 Share Posted May 23, 2011 @QWERTYUIoP:> Thought I'd report this; When you chat any longer than the picScreen, instead of going over the line, it just carries on, off-screen.I know this is like almost a month old topic, but I didn't feel like creating a whole new topic for it.But I have the same problem, and I can't figure out how to put a limit on it.I tried random things, but nothing did what I wanted it to do, limiting the chars which you can type at once. Link to comment Share on other sites More sharing options...
crzyone9584 Posted May 23, 2011 Share Posted May 23, 2011 You guys are having the problem because there is no code to wrap the text how it currently is. Link to comment Share on other sites More sharing options...
Carim123 Posted May 24, 2011 Share Posted May 24, 2011 > sString = Mid$(Start, SplitPoint) & vbNewLine & Mid$(SplitPoint, End)Although, it's not like I know where to use it. I know Robin said to put it in the word wrap function…either never seen it, or just have to make one... Link to comment Share on other sites More sharing options...
Robin Posted May 24, 2011 Share Posted May 24, 2011 @QWERTYUIoP:> Although, it's not like I know where to use it. I know Robin said to put it in the word wrap function…either never seen it, or just have to make one...I posted that code in a completely unrelated thread for someone who wanted to know how to create a word wrap function. They wanted to know how to add a line break at a certain point in the string.Copying & pasting snippets of code _when you didn't even bother to look at what they do_ is fucking retarded. Link to comment Share on other sites More sharing options...
Antisora Posted July 24, 2011 Share Posted July 24, 2011 I cant Find ' draw fps in Render_Graphics, let alone the whole project. Link to comment Share on other sites More sharing options...
Whackeddie99 Posted August 12, 2011 Share Posted August 12, 2011 Hey, I hate to bring this back to life, but I've been reading up around the forums about this, and I can't understand how I can get rid of the chatbox while using this, w/o getting lots of errors. Can somebody tell me what needs to be done? Link to comment Share on other sites More sharing options...
RyokuHasu Posted August 12, 2011 Share Posted August 12, 2011 lower right of VB6, there is a properties window, at the bottom of that is the "Visible" property, set it to False.In my game I have it set up to show the chatbox when you use a bank , store , or trade.Also if your going to draw the chat to the screen I would suggest making the screen bigger. Link to comment Share on other sites More sharing options...
quintensky Posted August 12, 2011 Share Posted August 12, 2011 when i chat it wont appear??what part of the tut did i miss? Link to comment Share on other sites More sharing options...
quintensky Posted August 12, 2011 Share Posted August 12, 2011 fixed it :):):):) ty for the tut, it really helped me! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now