Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

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 Trainee Engineer

    Messages:
    13
    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 Master Engineer

    Messages:
    9,625
  3. Wicorel Senior Engineer

    Messages:
    1,243
    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 Trainee Engineer

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

    Messages:
    20
    LCD Panel is also a text surface.
    Code:
    IMyTextPanel textPanel = GetMyLcdPanel(...);
    ...
    IMyTextSurface surface = (IMyTextSurface)textPanel;
     
  6. 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 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.