00:00
00:00
Newgrounds Background Image Theme

BorfDoggo just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

If Textbox == centered

375 Views | 4 Replies
New Topic Respond to this Topic

If Textbox == centered 2014-12-04 12:37:25


I've tried

if(txt.align=="CENTER"){

and

if(txt.TextFormatAlign=="CENTER"){

Response to If Textbox == centered 2014-12-04 14:41:41


At 12/4/14 12:37 PM, Aprime wrote: I've tried

if(txt.align=="CENTER"){

and

if(txt.TextFormatAlign=="CENTER"){

I smell an XY problem..

What about tracing "txt.alignment"?

Response to If Textbox == centered 2014-12-04 17:13:05 (edited 2014-12-04 17:13:38)


At 12/4/14 12:37 PM, Aprime wrote: I've tried

if(txt.align=="CENTER"){

and

if(txt.TextFormatAlign=="CENTER"){

you need to have "CENTER" lowercased, but a better way to do this is....

if(txt.getTextFormat().align == TextFormatAlign.CENTER){

}

BBS Signature

Response to If Textbox == centered 2014-12-05 01:18:09


I can't think of a reason to do this unless you're trying to create some kind of text editor.
What's the actual problem?


If ya have something to say, PM me. I have a lot of time to spare.

Also never PM egg82.

BBS Signature

Response to If Textbox == centered 2014-12-05 05:41:51


At 12/4/14 02:41 PM, Barzona wrote: I smell an XY problem..

What about tracing "txt.alignment"?

Fixed

At 12/4/14 05:13 PM, swishcheese wrote: if(txt.getTextFormat().align == TextFormatAlign.CENTER){

Thanks a bunch! :D

At 12/5/14 01:18 AM, MintPaw wrote: I can't think of a reason to do this unless you're trying to create some kind of text editor.

I've made a template for some work I've done. Sometimes I center the text and others I don't. If my text is centered I'd like the button below it to be too. Instead of manually moving it, and having the chance that the button isn't centered then there's a problem. Plus the buttons width changes dynamically depending on what's inside. The registration of the button is top left and not in the middle.

That's that, but it's all sorted now thanks to swishcheese