flixel-ui icon indicating copy to clipboard operation
flixel-ui copied to clipboard

Adjust text content to fit a defined width or height

Open gltovar opened this issue 10 years ago • 9 comments

Hey I've been working on this feature where you can scale down a textfield to either:

  1. Fit a single line textfield to a defined width
  2. Fit a multi line textfield to a defined height

here is my first pass, do you feel like it belongs in this project? If so, there is much to do before it can be pulled in. Not sure the proper place for the utilities and I'm sure it can be optimized better. Let me know you thoughts =]

here is the initial commit: https://github.com/gltovar/flixel-ui/commit/8eefdad0fbdb3af1d1c99ce66dd2cf6aa2bf6a60

here is a screen shot: http://i.imgur.com/TSzBtYY.png

and the code that generated that screenshot: https://gist.github.com/gltovar/6881361

gltovar avatar Oct 08 '13 08:10 gltovar

Hey, this looks super useful. If you can stabilize this I'll happily accept a pull request.

larsiusprime avatar Oct 08 '13 15:10 larsiusprime

do you have any suggestions on how this should be integrated? should I add the static utilities to U.hx, or do they make sense in flxuitext? (for example)

gltovar avatar Oct 08 '13 21:10 gltovar

U.hx is a bit of a kludge already... a lot of the functions that are in there might need to be refactored a bit or moved around as I think they duplicate a lot of what's already available in the flixel.util package.

So I'd stick it in FlxUIText as helper functions.

larsiusprime avatar Oct 10 '13 00:10 larsiusprime

Any word on this? Looks good to me, can you make sure it's still compatible with latest stuff and if so, create a branch and make a pull request? Then I'll test it and if it works, I'll accept it.

larsiusprime avatar Mar 11 '14 19:03 larsiusprime

hey man, sorry I didn't get back sooner. I just started a new job at Amazon, I can take a look at it in a few nights/this weekend, get it not breaking and build a test case. I'll let you know if I have any problems with it.

On Tue, Mar 11, 2014 at 12:48 PM, Lars Doucet [email protected]:

Any word on this? Looks good to me, can you make sure it's still compatible with latest stuff and if so, create a branch and make a pull request? Then I'll test it and if it works, I'll accept it.

Reply to this email directly or view it on GitHubhttps://github.com/HaxeFlixel/flixel-ui/issues/22#issuecomment-37341260 .

gltovar avatar Mar 19 '14 19:03 gltovar

NP! Take your time.

larsiusprime avatar Mar 19 '14 22:03 larsiusprime

Any updates on this?

larsiusprime avatar Jan 19 '15 18:01 larsiusprime

What do you think @Gama11? Should we wrap this into a utility function or something?

larsiusprime avatar Jan 19 '15 20:01 larsiusprime

My apologies, I've completely forgotten about this. I can't say I have much input on this, I'll leave it to you if you have ideas on proper integration. Let me know if you have any questions.

gltovar avatar Jan 19 '15 21:01 gltovar