Any possible way to set maxLines of Text in Flame?
I've tried using TextComponent and TextBoxComponent but I still cannot find any solution to set the line number of a text. I tried the following textRenderer, still not worked:
textRenderer = TextPaint(
style: const TextStyle(overflow: TextOverflow.ellipsis, height: 1,
fontSize: 18, color: Color.fromARGB(255, 215, 215, 215)));
Any solution, please kindly help me. Thanks
Thay feature doesn't exist currently afaik, but it would be a good addition.
I looked at this real quick and I would think extending TextBoxConfig would be the ideal way to address this. If maxHeight is set and the text exceeds the height, you could either truncate the text or if time per char is set, you could vertically scroll the text. Same for like if can grow is set, then start at 1 line grow until max height then scroll.
I don't think text component itself really needs the max height, but maybe??
Additionally, I haven't really looked at the flame_jenny package, but does it need the textboxcomponent to function or does it already do the scrolling text thing I mentioned?
@munsterlander Only maxWidth is found in TextBoxConfig. maxHeight isn't available
super(
position: position,
boxConfig: TextBoxConfig(
maxWidth: 160,
growingBox: false,
)
@munsterlander Only maxWidth is found in TextBoxConfig. maxHeight isn't available
super( position: position, boxConfig: TextBoxConfig( maxWidth: 160, growingBox: false, )
Correct. That's why I was asking if we should look at extending config.
@munsterlander I see thank you anyways. The only way is to customize my own to cut a string for a specific line number.
@tinhok02 cool. Yeah I was actually thinking out loud for @spydon to see if he thought that wild be the appropriate response and if a pr should be created for it. Not certain that I can make it a success, but I also know with the work on Jenny that @st-pasha might have some ideas about this or if it's being addressed in flame_jenny, etc.
Sure, a PR adding that to the config would be great.