C4 Engine

Facebook Twitter Google+ YouTube IndieDB
News Explore
Download Demo
Feature List
Licensing Info
Screenshots
Video
Support
Support Forums
C4 Engine Wiki
API Documentation
Release Notes
Purchase My Account

Multiline Text Widget issues

Topics about programming that don't fit into another category.

Multiline Text Widget issues

Postby CptnWaffles » 26 Feb 2012, 13:36

Heya! I'm having some issues with what is likely a simple concept but after a few hours of poking I can't find anything. I'm creating a TextWidget in code and reading it's text in via a string table but despite the line having multiple '\n's in it the text is staying a single line. You can see the final result here: http://postimage.org/image/kwo52gss1/

I've tried calling SplitLines() with the render line count set to 8, the text box is a sufficient size (~350 x ~220), the new line characters are definitely in the string (GetLineCount always returns > 1). :?: So why am I always getting all of my text on a single line with the \n characters replaced with spaces?

Thanks in advance for the help! :D
"A straight line may be the shortest distance between two points, but it is by no means the most interesting." ~ Doctor Who
User avatar
CptnWaffles
Experienced User
Experienced User
 
Posts: 169
Joined: 04 Nov 2008, 18:13
Location: Santa Cruz, CA

Re: Multiline Text Widget issues

Postby CodeNewt » 26 Feb 2012, 13:39

Grabbing it from the C4 API. Just call the SetTextFlags method and set the flag kTextWrapped.

http://www.terathon.com/c4engine/doco/I ... idget.html
By default, only the kTextClipped flag is set, and the text widget renders text on a single line that is clipped on the left and right sides of the widget's bounds. A text widget can be changed to a multi-line text box configuration by calling the TextWidget::SetTextFlags function to set the kTextWrapped flag.


If you are using the C4 Panel editor, just hit the check box for multiline.
CodeNewt
Power User
Power User
 
Posts: 740
Joined: 16 Oct 2009, 18:09

Re: Multiline Text Widget issues

Postby CptnWaffles » 26 Feb 2012, 13:57

I figured it would be something tiny I overlooked :oops: Thanks again for the help :)
"A straight line may be the shortest distance between two points, but it is by no means the most interesting." ~ Doctor Who
User avatar
CptnWaffles
Experienced User
Experienced User
 
Posts: 169
Joined: 04 Nov 2008, 18:13
Location: Santa Cruz, CA

Re: Multiline Text Widget issues

Postby CodeNewt » 26 Feb 2012, 14:33

No problem! :) That is what the forums are for. :p
CodeNewt
Power User
Power User
 
Posts: 740
Joined: 16 Oct 2009, 18:09

Re: Multiline Text Widget issues

Postby Robert » 26 Feb 2012, 15:06

If you're placing the text widget in the panel editor it also has a flag for that.
Robert
Power User
Power User
 
Posts: 473
Joined: 05 Dec 2010, 15:07


Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Company Contact Privacy Policy Site Map Copyright © 2001–2014 Terathon Software LLC Terathon Software