Esempio n. 1
0
        // overridden from EditboxWindowRenderer base class.
        public override int GetTextIndexFromPosition(Lunatics.Mathematics.Vector2 pt)
        {
            var w = (Editbox)Window;

            // calculate final window position to be checked
            var wndx = CoordConverter.ScreenToWindowX(w, pt.X);

            wndx -= _lastTextOffset;

            // Return the proper index
            return(w.GetFont().GetCharAtPixel(w.IsTextMaskingEnabled()
                                                  ? new string(w.GetTextMaskCodePoint(), w.GetTextVisual().Length)
                                                  : w.GetTextVisual(), wndx));
        }