Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How to find the position of a specific word in multiline text?
Started by chodongwon82 Nov 09 2018 12:55 AM

1 reply to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

chodongwon82

[GLOBAL: userInfoPane.html]
chodongwon82
  • Enthusiast

  • 44 posts
  • Corona SDK

How to find the position of a specific word in multiline text?

I wanna find and then create a display.newLine.

 

like this:

 

blah blah blah. Have

a nice day~! blah bla

h blah blah blah blah



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,286 posts
  • Corona SDK

If you mean <x,y> position, not possible, unless you have all of the metrics for each letter in the font.

 

Text (multi-line or otherwise) is a single display object.  There are no letters as objects.

 

The easiest way I can see to do this is to use a bitmapped font and library.  In that case each letter can be a discrete object, or at least each word.




[topic_controls]
[/topic_controls]