Browse Source

For increased sharpness and to avoid artifacts, switch UI texture to nearest filtering when scaling the editor UI.

Lasse Öörni 8 years ago
parent
commit
94af133ca4
1 changed files with 5 additions and 0 deletions
  1. 5 0
      bin/Data/Scripts/Editor.as

+ 5 - 0
bin/Data/Scripts/Editor.as

@@ -64,6 +64,11 @@ void Start()
     {
         // Should we use the inputScale itself to scale UI?
         ui.scale = 2;
+        // When UI scale is increased, also set the UI atlas to nearest filtering to avoid artifacts
+        // (there is no padding) and to have a sharper look
+        Texture2D@ uiTex = cache.GetResource("Texture2D", "Textures/UI.png");
+        if (uiTex !is null)
+            uiTex.filterMode = FILTER_NEAREST;
     }
     // Use system clipboard to allow transport of text in & out from the editor
     ui.useSystemClipboard = true;