I made a desktop popup dictionary for games and apps. It shows definitions on hover and allows you to create Anki cards.

Hey r/LearnJapanese, I created a desktop app that allows you to directly hover over text in games for a popup dictionary. It’s free, open source, and connects to Anki.

Screenshots: [https://imgur.com/a/r95EvJX](https://imgur.com/a/r95EvJX)

## Background

2 years ago, I shared an app to learn and retain Japanese words from games [in this post](https://www.reddit.com/r/LearnJapanese/comments/k4k5n5/i_built_an_app_to_learn_and_retain_japanese_words/). I was shocked by the responses, and I’ve been collecting a lot of feedback and improving the app.

Lately, I wanted to make it even more intuitive and easy to use.

Then it hit me – what if it just worked like Yomichan on a website?

Lots of prototypes and 3 a.m. grinds later, I managed to build a Frankenstein app by connecting a Python GUI library to a gutted Rikaikun shell and a monkey-patched OCR library.

## Features

* **Automatic window and text detection**: no need to select your window or draw rectangles over text boundaries. It will automatically do it for you.
* **State of the art OCR**: the app uses [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR). Its speed and accuracy is the primary reason that could make this project viable
* **Embedded Rikaikun**: the app uses a modified Rikaikun that now uses AnkiConnect functionality
* **Anki Cards with Screenshots**: you can now quickly create Anki cards of your game with fields including screenshot, word, sentence, word audio, and pitch.

## How to use

1. Unzip and launch *Game2Text.exe*.
2. A console will pop up and run some commands. This will take several seconds.
3. Select your application window and press start. Alternatively, you can select an area if you can’t find your application.
4. Hover over the text in your game.

## Adding words to Anki

1. Make sure AnkiConnect is installed and Anki is open.
2. In Game2Text, navigate to the \*Anki\* tab and select your deck, model, and fields.
3. When the popup dictionary (Rikaikun) is active, press “s”. A success popup will come up on the top left corner.

## Rikaikun hot keys
– **c** -> copy to clipboard
– **shift** -> toggle to kanji dictionary
– **s** -> add to Anki

## Download

[https://github.com/mathewthe2/Game2Text-Lightning/releases/tag/v0.0.1](https://github.com/mathewthe2/Game2Text-Lightning/releases/tag/v0.0.1)

## Source Code

[https://github.com/mathewthe2/Game2Text-Lightning](https://github.com/mathewthe2/Game2Text-Lightning)

## Plans
– More dictionary popup styles
– Custom dictionaries
– Furigana generation

12 comments
  1. will this replace the original game2text? Also will the game2text website change?

  2. This sounds amazing. Any chance you’ll make it available for Mac too? Sorry, I have no idea about coding, not sure how hard that would be to achieve. Thanks!

  3. This is incredible, thank you!

    Do you have plans to have this work for other languages like French or Korean as well? It would be a lifesaver in my studies. I unfortunately don’t know how to do this myself.

  4. This looks great! I’ve literally just started using and getting really familiar with game2text the last month or two while starting my first games in japanese (P4G and Zero Escape bundle.) I’ll download and try this out tonight! I could leave some thoughts or suggestions or a comparison to help give people idea which might be better for certain kinds of games. Although I’m sure you’ve probably got lots of ideas to improve it and are doing it for free, so I’m just grateful for all the work you’ve already done thats allowed learners like me to start gaming in Japanese! Thanks!

    Edit: adding thoughts, referring to it as Lighting BTW because it’s a dope name

    Well I’d say it works pretty well overall. It’s actually incredibly accurate out of the box for picking up text. It does pretty well when the text is over an uneven background, like when a white subtitle appears over a face or the sky or something. I’ve found it sometimes has trouble there, but a super easy workaround is just using the log or scrolling the text up or down the screen or finding a way to change the backdrop, like going into the log, usually allows the program to pick up whatever pesky kanji it couldn’t quite make out before. Lightning seems to be quicker and more accurate than game2text out of the box, however it would be cool if we had the option to change the ocr contrast kind of options that we have in game2text like the gausian blur and inverting color, but still even without that I’d say lightning is more accurate, and I have a feeling that option couldn’t be added without messing up the overall accuracy of the program.

    As for bugs, it has a few issues, and these are minor annoyances I’m putting here for maybe debugging or idk how programing works. There’s like 3 main types of bugs I’ve found. They also aren’t game breaking so to speak and are all solved by restarting the program which luckily only takes like 10 seconds.

    First, I guess is it just not starting right or crashing for seemingly no reason while running. Once in a while it just doesn’t start right, or is running fine and then hits a snag and doesn’t work right. Solved with super quick restart of the program.

    Second is not deleting previous text boxes so that when you hover over an area where there was text a couple minutes ago, it comes up with the old text. The screen gets background cluttered with those textboxes and its annoying, but again just restarting the program solves it so it’s not a big deal. That seems to be an issue with removing the old text boxes and the program lines indicate that it hit a snag deleting them and I am knowledgeless but I assume that’s where this issue stems from.

    The third issue is not inserting the text into the text box it made. So it will put the background text box up showing it knows text is there, but gets stuck and never inserts it to the box so you can’t search the text. Again easily solved by restarting the program. I’m not sure where this issue comes from, whether it’s not deleting an old text box and can’t insert the text in the new one, or if it’s another problem because in these instances there aren’t multiple background text boxes like the previous example. It just fails to insert text, where in the previous example it still Inserts the text but it just gets hard to read because of all the old text boxes.

    And one more annoying thing that I personally just can’t seem to figure out is how to keep it like over the game. Sometimes its because the text boxes are another program and so when I hover over the text box the game minimizes or the screen goes black and it only shows what I’m hovering over (thinking about it i could probably solve this by checking always on top or some variation of ordering which windows are on top.) It doesn’t even show the whole text box, just the word and definition I’m hovering over and the rest of the screen is black. I assume it’s because of how I have the game set up like full screen, windowed, borderless, whatever. I know If it’s in I think windowed there are no problems like that but it makes the game window too small for me to really see or enjoy because my setup is jank. I think I use it in borderless so I can see, and I can switch in and out quickly, but this way sometimes leads to that issue I mentioned before. Luckily that also seems to usually be solved by restarting the program, or just stopping and starting the screen grab ocr, or pulling up the command line type window and the lightning window over the game; then pulling the game up and clicking around (although that can skip text lines sometimes, but there’s a log)

    Oh also sometimes it gets tripped up if you add too many anki cards too quickly but thats user error. It’d be nice If the add to anki thing was slightly more noticeable or maybe moveable or like other people said if there was an optional chime sound. If I could move that box that confirms it was added from the top left corner to like the edge of the inserted text box since I’m already looking at that text box that would be so much more noticeable

    So all in all, I think it really does work great for what it is and what it does and your story of frantically throwing it together in a night. Although it crashes a bit, it really is super simple to restart it. It takes less time to restart it than it does to restart game2text and redraw the box, or if game2text can’t get a kanji and you mess with it, like this is quicker even with the crashes.

    This lightning version plus the original game2text and that built in texthooker and regular texthooker, really is enough for just about anyone to figure out a setup for just about any game with just a little bit of trial and error which I find kind of fun anyway kind of like a puzzle.

    Thanks again for the great tool! BTW I have like 8 hours of playtime in the first zero escape game 999 whatever, and am only on the scene just past the first prologue tutorial type escape room. There’s like 100 scenes left. Sure some of that time was spent setting up settings, finding my preferred setup with ocr, and testing these tools, but it might take me 500 hours to get through this game! Luckily these tools allow me to play, and they are so easy once you figure em out that I could go from a sleeping pc to using Lighting in a game and reading new japanese sentences in less than 2 minutes. That takes away a lot of set up anxiety, like the “yeah I wanna play this game but it’s gonna take an hour to set up and mess with settings and I’ll finally play one match and have to get off” kind of feeling is completely eliminated by using these programs. And that alone is such a huge help and motivating factor.

  5. I’ve been trying this out in Elden Ring and the screen frequently turns black when I hover over words, this is probably not intentional, right? Noticed that this mostly happens when I click on a word

  6. I finally got around to trying this after seeing it the other day and *wow* this is genuinely amazing, one of the best resources I’ve seen as someone who loves games and JP learning. Tried it for a few mins with Xenoblade Chronicles (via Ryujinx) and it worked extremely well. It feels so natural to use which tbh was not at all the case with the original capture2text which I couldn’t really figure out when I gave it a shot before. Sad it didn’t get more upvotes here, deserves them. I’ll probably get hundreds of hours of use out of this easily. Will try it more when I have a bit more free time.

    I am curious how it handles text with a bit more crust like snes or 3ds or psp or something, have you tried it with any of those? I’ll try myself sometime, and it’s amazing regardless. Thanks so much for making this!

  7. If it worked a bit better, this would be amazing. Sadly, I’m experiencing various issues:

    Like other users, the whole screen sometimes turns completely black.

    The application I tried it on only starts working after changing the window mode (from Fullscreen to Windowed or from Windowed to Fullscreen doesn’t matter. Before, the OCR doesn’t work, afterwards it does)

    Clipboard and Anki hotkeys don’t work. Sometimes they did, I think only when the screen was “blacked out”.

    Edit: It worked much better when picking Desktop Area as the Capture Method. At first I thought that was completely broken, because the Region Select wasn’t working, but it seems you have to select from Top Left to Bottom Right.

    I love the idea of this program and I’d love to see it grow. I wish I could help, but as a web developer with no experience in Python I doubt I can do much. I realize that in making this there are various really difficult problems to solve and I **wish you the best of luck!**

Leave a Reply
You May Also Like