留言板 留言板

返回

Matching size of shape to amount of text

触发器
Matching size of shape to amount of text
答复
24-4-12 下午5:59
Hello SB Team!  
I'm working on a simulation of a new live chat platform in which users will be entering responses to scenarios.  After they type their response, I'd like a bubble to be added to the chat thread with their response as the text.  Since we don't know how much or how little the rep will type, Is there a way to set the size of the shape to contain the amount of text that is entered?  The text would be held in a variable then the bubble would appear and text of the bubble set when the "send" button is clicked. 
Any ideas would be appreciated!  
Scott
0 (0 票)

RE: Matching size of shape to amount of text
答复
24-4-12 下午6:20 回复Scott Sheridan。
Hi Scott,
There's a brand new feature on Shapes and Buttons called "Shrink Text to Fit" (see the properties for those two objects). Would that help? That's sort of the inverse of what you want - reduce the text to fit a specified shape, as opposed to grow the shape to the fit the text.

I think all you can do at the moment is to use a scrolling text field to house the learner's text, or start checking to see how many characters the learner has typed in and show different sized shapes based on the how much text there is (0-100 chars = Shape 1; 101-200 chars = Shape 2, etc). You might have to change your whole layout of objects based on the amount of text, too (chats that have come before). I don't know how you'd deal with an unlimited amount of text, either. Usually we use scrolling text for that sort of thing. Chat interfaces are pretty dynamic!

Another new feature is to set the size the height (or width) of a Text or RichText object. Depending on the shape of your chat bubble, you might be able to use that. You would need to count characters and make a guess at the size, though.

See attached screenshot. The red "length" block is found under Advanced > Text. Hope one of those helps!
0 (0 票)

RE: Matching size of shape to amount of text
答复
24-4-12 下午6:24 回复Scott Sheridan。
HI Scott,

A while ago I created something similar to what you are looking for. This link below to an .sb file simulates a texting conversion. Whith a little imagination it could easily be automated to have only one side of the conversation manually typed. Hope that helps. Im sure there a number of other ways something like this could be accomplished.

https://share.suddenlysmart.com/public/support/conversation-divs.sb4

Thanks,
John Malatino
0 (0 票)

RE: Matching size of shape to amount of text
答复
24-4-12 下午6:36 回复John Malatino。
Thanks, Nav and John! 
I'll take a look at both of these solutions and see which will work best for this activity.  
Scott
0 (0 票)