Lingo Dictionary > L-N > locToCharPos() |  |

locToCharPos()

Syntax

    member(whichCastMember). locToCharPos(location )
    locToCharPos(member whichCastMember, location)

Description

Function; returns a number that identifies which character in the specified field cast member is closest to the point within the field specified by `location`. The value for `location` is a point relative to the upper left corner of the field cast member.

The value 1 corresponds to the first character in the string, the value 2 corresponds to the second character in the string, and so on.

Example

This statement determines which character is closest to the point 100 pixels to the right and 100 pixels below the upper left corner of the field cast member Today's News. The statement then assigns the result to the variable `PageDesign`.

    pageDesign = member("Today's News").locToCharPos(point(100, 100))

Example

This handler tells which character is under the cursor when the user clicks the mouse over the field sprite Information:

    on mouseDown
    	put member("Information").locToCharPos(the clickLoc - \
    	(sprite(the clickOn).loc))
    end