odwdinc / Python-SimConnect

Python interface for MSFS2020 SimConnect.dll
GNU Affero General Public License v3.0
273 stars 106 forks source link

Add support for sending text messages to the screen? #68

Closed musurca closed 3 years ago

musurca commented 3 years ago

It has been possible since FSX to send short text messages to the screen via SimConnect (ATIS messages, etc.), and that ability remains in MSFS2020—the vPilot client, for example, makes use of it to transmit text communications from ATC.

It would be great to have an easy hook to use that feature! (Thanks for your great work on this so far, by the way.)

odwdinc commented 3 years ago

added in 0.4.21 https://github.com/odwdinc/Python-SimConnect/blob/9d855a4492804005c7f50017102209a7675abd26/SimConnect/SimConnect.py#L444

Per the SDK:

Menu SimConnect_Text Minimal support (TEXT_TYPE_PRINT_color) Simple text works, (TEXT_TYPE_SCROLLING_color) scrolling gives simple text, (TEXT_TYPE_MENU) menu gives no error-no response. (_color) color is ignored

Sample:

from SimConnect import *
import logging
from SimConnect.Enum import *
from time import sleep

logging.basicConfig(level=logging.DEBUG)
LOGGER = logging.getLogger(__name__)
LOGGER.info("START")
sm = SimConnect()

sm.sendText("Hello Python-SimConnect", 10, SIMCONNECT_TEXT_TYPE.SIMCONNECT_TEXT_TYPE_SCROLL_BLUE)

sm.exit()

image

musurca commented 3 years ago

amazing-- thank you!