BGE as a wrapper program for another application

Would it be possible to make an application that can be acted as a wrapper program? For example: I want to run notepad.exe within the program I made using blender. By “within” I mean literally running within the game window. Would that be possible to render that in a simple 2d plane?

Any help is appreciated. :slight_smile:

yeah - we can parse input / get where we click to move a cursor around and then insert into the string there when we type.

the hardest part would be finding where the cursor is when you click,

we would almost want to emit a invisible face per font letter and set a attribute in it, string[index]

I want to simply run notepad in a 2d plane.

I’m trying to execute this following script:

import bge
import subprocess
 
scene = bge.logic.getCurrentScene()

def open_notepad():
    try:
        notepad_path = r'C:\Windows\System32\notepad.exe'

        subprocess.Popen([notepad_path], shell=True)
    except Exception as e:
        print("Error opening Notepad: {}".format(e))

keyboard_sensor_object_name = 'Plane'

if keyboard_sensor_object_name in scene.objects:
    keyboard_sensor_object = scene.objects[keyboard_sensor_object_name]

    if keyboard_sensor_object.sensors['Keyboard'].positive:
        open_notepad()
else:
    print("Error: Object '{}' not found in the scene.".format(keyboard_sensor_object_name))

But It’s not working and I’m getting this error:

Traceback (most recent call last):
File “\Text”, line 3, in
AttributeError: module ‘subprocess’ has no attribute ‘logic’

What am I doing wrong?

Okay so i’ve managed to fix the issue. It was a silly mistake on my part. Actually the 2d plane which was in my scene was called “Plane.001” instead of “Plane”. So I renamed the object name. But now it’s opening notepad outside the game window. I can’t seem to figure it out.

You would need to render the notebook.exe to a offscreen buffer, and replace a viewport with it, and then catch input