LCD Screen surface issue
Outdated
LCD Screens implement both IMyTextDisplay (is a surface) and IMyTextDisplayProvider (has surfaces). The surface that is also the block itself is not the same as the surface that is made available through the block as a provider. In other words, LCD Panels have two surfaces: One that is also the block and is visible, and one that is supplied via its provider interface that is not visible.
Normally I would expect this code to work on any block that has surfaces:
var block = GridTerminalSystem.GetBlockWithName(someBlockName); var surface = ((IMyTextSurfaceProvider)block).GetSurface(0); surface.ContentType = ContentType.TEXT_AND_IMAGE; surface.WriteText("Test");
But, for LCD Panels, it doesn't appear to do anything since it's operating on the hidden surface. In order to make this code generic enough to work on any block with surfaces, it would have to do something like:
var block = GridTerminalSystem.GetBlockWithName(someBlockName); var surface = block is IMyTextSurface ? (IMyTextSurface)block : ((IMyTextSurfaceProvider)block).GetSurface(0); surface.ContentType = ContentType.TEXT_AND_IMAGE; surface.WriteText("Test");
Hello, Engineer!
Thank you for your feedback! Your topic has been added between considered issues.
Please keep voting for the issue as it will help us to identify the most serious bugs.
We really appreciate your patience.
Kind Regards
Keen Software House: QA Department
Hello, Engineer!
Thank you for your feedback! Your topic has been added between considered issues.
Please keep voting for the issue as it will help us to identify the most serious bugs.
We really appreciate your patience.
Kind Regards
Keen Software House: QA Department
https://github.com/malware-dev/MDK-SE/wiki/Sandbox.ModAPI.Ingame.IMyTextPanel
https://support.keenswh.com/spaceengineers/general/topic/please-consider-making-lcd-panels-also-an-instance-of-imytextpanelprovider
https://github.com/malware-dev/MDK-SE/wiki/Sandbox.ModAPI.Ingame.IMyTextPanel
https://support.keenswh.com/spaceengineers/general/topic/please-consider-making-lcd-panels-also-an-instance-of-imytextpanelprovider
Replies have been locked on this page!