So you know that white square that flashes before you type a word, the cursor!
So I’m programming this game and currently have my main menu screen to look like Commodore - DOS terminal, I’m struggling with making a flashing cursor though. I found a topic like this but there was nothing I could take from it. So basically I want to create the Commodore flashing cursor, I already have it there and I have the flashing mechanism added. I just need help with the cursor to follow behind the text when I type. I cant find any way to do it, I need help.
I haven’t used a Commodore DOS terminal before. But if it’s anything like the windows enter text field then I’d probably just toggle between the text (ASCII Code 124) e.g.
Enter text
to Enter text|
or Enter text□
You can also make a custom character in TMP if it isn’t in the font.
1 Like
I’ve figured out a solution, so after reading @CodeKiwi 's reply I scrolled down on the TMP input field and was able to find a caret width and color option. I wasn’t able to actually make the width higher than 5 so I made my own script for it so I can go above that to make a nice looking commodore cursor. OH and you can also change the blink rate there too! anyways here is the code which is extremely basic:
public class CursorFollow : MonoBehaviour
{
public TMP_InputField inputField;
public int cursorWidth;
public int blinkRate;
void Update()
{
inputField.caretWidth = cursorWidth;
inputField.caretBlinkRate = blinkRate;
}
}
2 Likes