Discuz! Board

 

 

Search
Discuz! Board Forum Integration Questions Chat view functions
View: 911|Reply: 6
go

Chat view functions

Rank: 3Rank: 3

Post on 2012-4-20 14:23 |All posts
What functions can we call on the chat view we get on calling getchatview?
Would be great if we could get a list of all functions allowed on the structure...otherwise more specifically, would like to know how to set text for each person sending a message (how do we add more lines of text with and without removing the other lines of text). How does the structure know which user is user 1, which is user 2 etc (I ask because we can set the color to be used for each user). How do we clear specific lines of text?


Also, the .pos() and .size() functions don't seem to be working on the chatView, the view doesn't move or change size...

Rank: 3Rank: 3

Post on 2012-4-23 20:39 |All posts
Ok, so found out how to do most of the things I need to do, except clear text from the chat view. chatView.clear() doesn't seem to work.

Also if I repeatedly call
var a = getchatview(10,80,0xffffff,0x3e92cd,0xdfddce);
I keep getting the same object with the same address back. Shouldn't I be getting a new object each time?

Rank: 3Rank: 3

Post on 2012-4-24 14:35 |All posts
Also, how do we auto scroll to the bottom of the display when we add new text to it?

Rank: 9Rank: 9Rank: 9

Post on 2012-4-25 04:16 |All posts
Hello,

you can write a sprite and add a label to it to show the chat messages.  for the input box, you can use v_create(V_INPUT_VIEW) to place an input box for user to type in.  whenever user types in, you can add the content as a label to the sprite.

Hope this helps.

Thanks.

Rank: 3Rank: 3

Post on 2012-4-25 13:36 |All posts
Well yes, that's one way to solve the problem, but there is a view type provided to display chat in Papaya as well, mention in the API_Reference pdf as
getchatview(fontsize,fontalpha,colorOfSystem, colorOfPerson1, colorOfPerson2,…..)

As it says in the SDK Manual under the Views heading, text can be added to Chat View in the following manner:
chat.text(content,0); // 0 being the person no.
chat.text(content,1); // 1 being the person no.

I have two questions regarding this topic:
1) how do we clear text from this view? All of the text in it, and if possible, specific lines from it.
2) calling getChatView() again gives me reference to the same object once more (I've tried this, the colors, object address, object id are the same as the previous chat display view object I created). How do I create a NEW chat display view?

Rank: 1

Post on 2012-6-4 16:26 |All posts
how do we auto scroll to the bottom of the display when we add new text to it?










------------------------------------------------------------------------------------------

Cheap Pandora Beads|Cheap Pandora Charms|Cheap Pandora Bracelets

Rank: 1

Post on 2012-6-7 15:53 |All posts
Thank you for this article. That’s all I can say. You most definitely have made this post into something special. You clearly know what you are doing, you’ve covered so many bases.Thanks!




--------------------------------------------------------------------------------

Cheap Thomas Sabo Carriers|Pandora Charms Sale|Cheap Pandora Beads
Security Q&A Change Security code Change

Archiver|Comsenz Inc.

All time is GMT+8, 2013-6-19 11:47 , Processed in 0.043843 second(s), 10 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.