Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Background of Tile Palette window.

Discussion in 'Editor & General Support' started by DevBaro, Feb 8, 2020.

  1. DevBaro

    DevBaro

    Joined:
    Apr 23, 2019
    Posts:
    13
    I have a tilemap with sprites all black, and my background window is black ! Is really difficult to identify my tiles. Can I change the background ?

    Image attached.
    Thanks
     

    Attached Files:

  2. Tom-Atom

    Tom-Atom

    Joined:
    Jun 29, 2014
    Posts:
    153
    The same problem here. Before last update (to 2019.3.1f1) tile palette background was grey. Now it is completely black.

    Is it possible to set its color somewhere?
     
  3. Tom-Atom

    Tom-Atom

    Joined:
    Jun 29, 2014
    Posts:
    153
    APSchmidtOfOld likes this.
  4. Papy_Pierre

    Papy_Pierre

    Joined:
    Jan 29, 2021
    Posts:
    2
  5. banjolasse

    banjolasse

    Joined:
    Feb 13, 2016
    Posts:
    9
    The link is dead and I have the same problem. Care to spell it out for me?
     
  6. Tom-Atom

    Tom-Atom

    Joined:
    Jun 29, 2014
    Posts:
    153
    Hi, I have some troubles to access old posts (picking it line by line from database :) ) But, here you go:

    Tile Palette window code is located in file GridPaintPaletteWindow.cs built-in package com.unity.2d.tilemap. This package is located in your Unity installation on this path: Unity\2019.3.1f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.2d.tilemap\Editor\

    Open file GridPaintPaletteWindow.cs and locate this part of code in onGUI() method:

    Code (CSharp):
    1. EditorGUILayout.BeginHorizontal();
    2. float leftMargin = (Screen.width / EditorGUIUtility.pixelsPerPoint - TilemapEditorTool.tilemapEditorToolsToolbarSize) * 0.5f;
    3. GUILayout.Space(leftMargin);
    4. EditorGUILayout.EditorToolbar(TilemapEditorTool.tilemapEditorTools);
    5. GUILayout.Space(leftMargin);
    6. EditorGUILayout.EndHorizontal();
    And change it to this:

    Code (CSharp):
    1. EditorGUILayout.BeginHorizontal();
    2. float leftMargin = (Screen.width / EditorGUIUtility.pixelsPerPoint - TilemapEditorTool.tilemapEditorToolsToolbarSize) * 0.5f;
    3. GUILayout.Space(leftMargin);
    4. EditorGUILayout.EditorToolbar(TilemapEditorTool.tilemapEditorTools);
    5. previewUtility.camera.backgroundColor = EditorGUILayout.ColorField(previewUtility.camera.backgroundColor);  // <--- CHANGE!
    6. GUILayout.Space(leftMargin);
    7. EditorGUILayout.EndHorizontal();
     
    Benjamen247 likes this.
  7. DoritoTheChips

    DoritoTheChips

    Joined:
    May 2, 2022
    Posts:
    2
    i tried to change the code but nothing changed, am i missing somethings ?
     
  8. DoritoTheChips

    DoritoTheChips

    Joined:
    May 2, 2022
    Posts:
    2
    never mind, it worked after rebooting my pc apparently
     
  9. Ghoowy

    Ghoowy

    Joined:
    Jun 17, 2021
    Posts:
    7
    @DoritoTheChips hey, in my version of Unity, the code changed so I can't locate the specified code, can you share where did you add the previewUtility line? (since I assume you're also using a more recent version of Unity than those guys in 2014 haha)
    Everywhere I tried didn't work
     
    Last edited: Aug 6, 2022
  10. Ghoowy

    Ghoowy

    Joined:
    Jun 17, 2021
    Posts:
    7
    @DoritoTheChips nevermind it finally worked, but now I just got a useless color picker that seems linked to nothing, it doesn't change the background color or anything, do you have any idea?
    Seems weird that it works for you but not for me


    EDIT: it's a default feature in 2022 beta version
     
    Last edited: Aug 6, 2022
    DoritoTheChips likes this.
  11. margaretcatter

    margaretcatter

    Joined:
    Aug 11, 2019
    Posts:
    1
    I got the tool to show up, changed the color but no matter what I do I can't get the background tiles to change color and I cant see anything.

    Im running Unity 2021.3.19f1

    upload_2023-2-27_19-50-14.png