Guys, how do i make scroll chat?

Get help using Construct 2

Post » Mon Nov 28, 2016 7:52 pm

Updated my original .capx post.

You can now scroll the chat while restricting the scrolling intelligently to specific scenarios (see comments in .capx)

This version logs messages to a dictionary but the history of the chat only goes as far as the layout's "margin" setting is set.
I could include a "load from dictionary" when the user tries to look at messages that are longer past than the margin goes.
But that would be a hell of work.
I won't try to replicate a full messenger here. If you want to, go ahead, but I'd say this is quite a base to start from.

With a margin of 2000, this version will be able to save around 100 one-line messages.
I don't know how much a higher margin (i.e. more objects being in the layout but not on screen) affect the performance, but that's to you to figure out. ;)
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Tue Dec 06, 2016 10:23 am

@randomly Any suggestions?
The whole life is in the movement.Stopped - fell asleep to hell...
B
14
S
3
G
1
Posts: 122
Reputation: 1,694

Post » Tue Dec 06, 2016 10:30 am

I'm using php server to send and recieve messages. So,they keeped in db,which created automatically for each user. All i use now-textarea,where all history is showing. I'm understand,that i should extend height of layer,where message-sprotes (from your example) are created for every created object and besides that-should use scrolly. I have already made scrolly. But can't discover how to connect your system with my scroll-system
The whole life is in the movement.Stopped - fell asleep to hell...
B
14
S
3
G
1
Posts: 122
Reputation: 1,694

Post » Tue Dec 06, 2016 12:19 pm

Sorry, I can't really grasp what you are saying.
Are you saying that you need to combine your message database to the C2 layout?

I have no experience with PHP, so you'll need to tell me how you access your PHP database and how you receive and send every user's messages dependent on the timestamp..
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Tue Dec 06, 2016 10:02 pm

@randomly no, your link isn't work again =(
The whole life is in the movement.Stopped - fell asleep to hell...
B
14
S
3
G
1
Posts: 122
Reputation: 1,694

Post » Tue Dec 06, 2016 10:10 pm

@randomly
i connect to DB via ajax->POST
recieve mess from DB via ajax.LastData
no datestamp using. into DB messages inserts for each user from each user with AutoIncrement Primary index.
for example
Code: Select all
<?php
$db=db;
$log=log;
$serv=serv;
$pass=pass;

$conn->mysqli_query($db,$log,$serv,$pass);

$sql1="create $user_POST['user'] (id INT 11, phone VARCHAR 11, name varchar 32, pass varchar 32);
 $conn->query($sql1);
echo User $_POST['user'] created;


?>
The whole life is in the movement.Stopped - fell asleep to hell...
B
14
S
3
G
1
Posts: 122
Reputation: 1,694

Post » Wed Dec 07, 2016 12:38 am

[quote=Axiomaltd]no, your link isn't work again =( [/quote]
Updated the link again. Dropbox seems to change the shared links without my knowledge..

___

About the PHP stuff: I have no knowledge whatsoever concerning PHP.
And I won't start learning it now, sorry.
I think, it will be better if you start a new thread with the messaging layout you got and focus that thread on PHP, so other users who actually know PHP can help you.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Wed Dec 07, 2016 12:53 am

instead of using text have you look into this: https://www.scirra.com/forum/plugin-iframe-amp-inserthtml_t149647

also @rexrainbow has a plugin to scroll text, i forgot what is called.
B
33
S
8
Posts: 62
Reputation: 2,043

Previous

Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher and 6 guests