Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Simulating a chat app

Still a little green? Ask your beginner's questions here

Simulating a chat app

Postby tohox » Tue Jun 25, 2019 8:51 pm

Hi,

I'm simulating a live chat app using a file as the text source for the "chat bubbles". These chat bubbles each consist of a rectangle TOP fed into a text TOP. I then use a timer CHOP who's onDone callback updates the text in the bubbles and manages text wrapping, sizing, positioning etc according to the new text. The callback also reseeds the timer with a random value every cycle so the replies feel more natural. So far so good with only two bubbles.

My first difficulty has to do with the fact that I obviously will need more than 2 bubbles to display the multiple replies in a long thread. I thought of programatically creating or copying the required OPs to generate the bubbles in a Python loop as new replies are required but this feels a bit tedious. Is there a simpler way of progressively "stamping" new parts onto an image?

My second difficulty is that the virtual chat display must automatically scroll once the replies reach the bottom so that earlier replies disappear at the top to make place for new ones at the bottom. I would know how to do this dynamically in pretty much any regular programming environment but am not sure what the proper TouchDesigner approach to achieving this would be. Currently I'm tempted to MovieOut a series of tiff images containing all the prerendered bubbles once when the app starts. Then I would Over TOP these onto a transparent rectangle until it reaches the bottom edge of the virtual display. From that point each time I add a new bubble I also move up the transparent rectangle a bit. This also feels a bit tedious...

Any simpler suggestions?

Thanks!
Attachments
Untitled.png
Untitled.png (159.07 KiB) Viewed 474 times
tohox
 
Posts: 58
Joined: Tue Jun 14, 2016 1:29 pm

Re: Simulating a chat app

Postby CorbinWhite » Wed Jun 26, 2019 2:03 pm

Hey, I’m working on a similar project for instant messaging. My methods are a bit different, but I’m running into the same trouble with scrolling. I’m thinking about using a replicator, to have a fixed number of messages or lines viewable, save the messages in a dictionary, and then have a scroll bar that can load messages into whatever OP I’m replicating to load older messages.

I’m in a super heavy tech week, but I’ll try to post my project soon. Maybe we can find some solutions together.
CorbinWhite
 
Posts: 128
Joined: Sun Aug 16, 2015 2:49 pm

Re: Simulating a chat app

Postby DigitalDown » Wed Jun 26, 2019 5:39 pm

The irony is I’m currently working on the exact same thing. I’ve taken a very different approach than pure TouchDesigner. There’s an app on iPhone called TextingStory where you can import a background. I imported a green screen and keyed it in Blender so that I could use some TouchDesigner animations in the background. Just an idea if you want a major shortcut. TextingStory has some smooth animations but it does cost for a license.
DigitalDown
 
Posts: 1
Joined: Sat Jun 15, 2019 3:50 pm


Return to Beginners

Who is online

Users browsing this forum: Google [Bot] and 13 guests