1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Writing to LCD Panels on the programmable block?

Discussion in 'Programming (In-game)' started by GreenBeanio, Apr 8, 2019.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. GreenBeanio

    GreenBeanio Trainee Engineer

    Messages:
    14
    It says in the update that you can write onto the LCD's on the program block and other stuff, but I can't figure out how. Does anyone know?
     
  2. Malware

    Malware Master Engineer

    Messages:
    9,867
  3. Wicorel

    Wicorel Senior Engineer

    Messages:
    1,263
    Simple Example:

    Code:
    			IMyTextSurface mesurface0 = Me.GetSurface(0);
    			mesurface0.ContentType = ContentType.TEXT_AND_IMAGE;
    			mesurface0.FontSize = 2;
    			mesurface0.Alignment = VRage.Game.GUI.TextPanel.TextAlignment.CENTER;
    			mesurface0.WriteText("Hello World");
    
     
  4. Pembroke

    Pembroke Trainee Engineer

    Messages:
    7
    Uhm... I confess my stupidity and humbly ask: How do you get the surface of an LCD Panel?
     
  5. Sinus32

    Sinus32 Trainee Engineer

    Messages:
    22
    LCD Panel is also a text surface.
    Code:
    IMyTextPanel textPanel = GetMyLcdPanel(...);
    ...
    IMyTextSurface surface = (IMyTextSurface)textPanel;
     
  6. Pembroke

    Pembroke Trainee Engineer

    Messages:
    7
    Oh, you can cast the panel itself to a surface. Right. Thank you!

    Edit: And I assume there's no longer any division between private and public texts on the LCD Panel? All those methods were marked as "deprecated" and IMyTextSurface didn't have them so whatever you put there with IMyTextSurface.WriteText should be visible to everyone?
     
    Last edited: Apr 10, 2019
  7. gothosan

    gothosan Junior Engineer

    Messages:
    723
    The TextAlignment seems great when wanting to place text in the middle of a line :)
     
Thread Status:
This last post in this thread was made more than 31 days old.