Ejemplo n.º 1
0
        public void RenderTextToTexture(string text, float scale, Color fontColor, Color backgroundColor, int textureResolution, int aspectRatio)
        {
            string offscreenTexture = "LCDOffscreenTexture_" + m_textPanel.EntityId;

            int width  = textureResolution * aspectRatio;
            int height = textureResolution;

            MyRenderProxy.CreateGeneratedTexture(offscreenTexture, width, height);
            MyRenderProxy.DrawString((int)MyDefinitionManager.Static.GetFontSafe(m_textPanel.Font.SubtypeName).Id.SubtypeId, Vector2.Zero, fontColor, new StringBuilder(text), scale, float.PositiveInfinity, offscreenTexture);
            MyRenderProxy.RenderOffscreenTextureToMaterial(RenderObjectIDs[0], PANEL_MATERIAL_NAME, offscreenTexture, backgroundColor);
        }
Ejemplo n.º 2
0
 public void CreateTexture(int area, Vector2I textureSize)
 {
     MyRenderProxy.CreateGeneratedTexture(this.GenerateOffscreenTextureName(this.m_entity.EntityId, area), textureSize.X, textureSize.Y, MyGeneratedTextureType.RGBA, 1);
 }