You have to test the position and width of the Text object (Question), no the Text Entry (AskQuery), the width of the AskQuery doesn’t get modified by the string it save… let me explain it ![]()
- You activate AskQuery to save the string in its memory
- You get the string from the AskQuery and copy it inside the Question object, now Question has the string of AskQuery
- If the size of Question is too big, delete characters until it fits
- The string in the memory of AskQuery is not modified, just the string copied in Question
Checking your image, I don’t know how I didn’t realize that, instead modifying the string of the Question text object, modify the memory of the AskQuery would be a better option (no performance hit to reduce the string length if it’s too long), but you have to test the position and size with the Question object anyway, the idea would be:
- You activate AskQuery to save the string in its memory
- You get the string from the AskQuery and copy it inside the Question object, now Question has the string of AskQuery
- If the size of Question is too big, delete the last character from the memory of AskQuery, and update the text of Question too
Even you don’t need a “While” event, since you just delete the last character from the memory, a real “writing limiter”, check the event 12:
AskErrorGirl.zip (925 KB)