0
$\begingroup$

I want to add some GUI without simulating 2D Controls in 3D, and I think Tkinter module is easy enough to use. I set up a simple scene to try my idea, but it seems not work. enter image description here Neither import tkinter nor import Tkinter, as I tried out, works probably. Any suggestions? Thanks.

$\endgroup$
  • $\begingroup$ only standard python modules are included in blender, not sure this will work but you can install python and force Blender to use it over the bundled one. $\endgroup$ – user2816 Jun 7 '16 at 3:32
  • $\begingroup$ @root how to make blender use a certain environment? $\endgroup$ – Page David Jun 7 '16 at 3:39
  • $\begingroup$ by default blender will try to use the system installed python, installing python will put it's installation path in the PATH environment variable and blender reads this variable at startup, also the python version you install must be the same version like the one blender has. I'm not exactly sure though ,maybe you can ask a question about this. $\endgroup$ – user2816 Jun 7 '16 at 3:43
  • $\begingroup$ @root should I try to add /usr/bin/env to PATH? $\endgroup$ – Page David Jun 7 '16 at 3:49
  • 1
    $\begingroup$ @root Sorry, I am rendering an animation, I don't want to interrupt it, I will try out this method after it is finished.(it seems to be work). Thanks. $\endgroup$ – Page David Jun 7 '16 at 3:55
0
$\begingroup$

Tkinter will freeze your game and create a popup window, which is probably not what you want. You could install it, but I wouldn't suggest it.

I've found that making simple interfaces is harder in code (eg tkinter) than it is in BGE with objects. Of course, by the time you want combo boxes, you probably want a GUI library. And these libraries do exist. There is a nice one called BGUI you should look into. This writes into openGL ontop of BGE, so it won't freeze your game or create external windows.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.