Flow/wrap text into an irregular shape

Roger Eller roger.e.eller at sealedair.com
Fri Dec 27 22:30:01 EST 2013


It has just occurred to me that scrolling within a shape will be very
cpu-active, as the visible text would be reflowing with each line advance.
 This probably isn't worth the cpu hogging it would need, and probably
wouldn't scroll very smoothly either.

Maybe instead of wrapping the text, I could use the triangle as a mask,
showing only the inside text.  To read or edit it, click and it becomes a
normal field again.  Perhaps not as nifty looking, but definitely easier to
achieve using graphic effects and/or ink blending.

~Roger


On Fri, Dec 27, 2013 at 10:17 PM, Roger Eller
<roger.e.eller at sealedair.com>wrote:

> I actually considered the multiple fields approach, but realizing that the
> text may need to scroll if there is more than what will fit, I have that
> one marked as having potential, but with some limitations.  I need to keep
> the original text fully intact, and this triangle idea is only to be a
> "view" for a custom interface made up of various sizes of triangles
> throughout.
>
> ~Roger
>
>
> On Fri, Dec 27, 2013 at 10:04 PM, Peter Haworth <pete at lcsql.com> wrote:
>
>> Not sure if this is more complicated or not but perhaps you could have
>> several fields vertically in the triangle, each the width of the triangle.
>> Then you'd have to figure out how much text would fit in each field
>> according to it's formatted width. Hmmm, maybe that is too complicated!
>>
>> Pete
>> lcSQL Software
>> On Dec 27, 2013 3:56 PM, "Roger Eller" <roger.e.eller at sealedair.com>
>> wrote:
>>
>> > Thanks Craig. It might be simpler to just use a monospaced font, and
>> know
>> > beforehand how many chars will fit each line of text, and wrap
>> accordingly.
>> >
>> > ~Roger
>> >
>> > On Fri, Dec 27, 2013 at 5:22 PM, <dunbarx at aol.com> wrote:
>> >
>> > > Hi.
>> > >
>> > >
>> > > This is doable. There are functions, like "the selectedLoc" that will
>> > work
>> > > for you. If you have a field with this in its script:
>> > >
>> > >
>> > >
>> > > on keyDown
>> > >
>> > >   put the selectedLoc
>> > >
>> > >
>> > >   pass keyDown
>> > > end keyDown
>> > >
>> > >
>> > > You can see the loc of the insertion point within whatever you are
>> > typing.
>> > > You can determine the X value of the triangle as it crosses each line
>> of
>> > > text, and if less than or greater than those values, you can, perhaps,
>> > pad
>> > > the field text with spaces until you are on the correct side of the
>> > > graphic. Much more management will be required, especially with long
>> > words
>> > > that might start outside the grc boundary but cross it before that
>> word
>> > is
>> > > finished, but, hey, you asked for it.
>> > >
>> > >
>> > > Craig
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > -----Original Message-----
>> > > From: Roger Eller <roger.e.eller at sealedair.com>
>> > > To: How to use LiveCode <use-livecode at lists.runrev.com>
>> > > Sent: Fri, Dec 27, 2013 4:36 pm
>> > > Subject: Flow/wrap text into an irregular shape
>> > >
>> > >
>> > >  Imagine a multi-line text field which overlays a triangle polygon,
>> which
>> > > is wide at the top, and comes to a point at the bottom.  I want the
>> text
>> > to
>> > > detect the edges of the triangle and wrap at those edges.  The result
>> > would
>> > > be a triangle shaped body of text (centered).  My question to you is
>> "How
>> > > can this be achieved?"
>> > >
>> > > ~Roger
>> > > _______________________________________________
>> > > use-livecode mailing list
>> > > use-livecode at lists.runrev.com
>> > > Please visit this url to subscribe, unsubscribe and manage your
>> > > subscription
>> > > preferences:
>> > > http://lists.runrev.com/mailman/listinfo/use-livecode
>> > >
>> > >
>> > > _______________________________________________
>> > > use-livecode mailing list
>> > > use-livecode at lists.runrev.com
>> > > Please visit this url to subscribe, unsubscribe and manage your
>> > > subscription preferences:
>> > > http://lists.runrev.com/mailman/listinfo/use-livecode
>> > >
>> > _______________________________________________
>> > use-livecode mailing list
>> > use-livecode at lists.runrev.com
>> > Please visit this url to subscribe, unsubscribe and manage your
>> > subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>> >
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>



More information about the use-livecode mailing list