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

Apply GUI Skin to UI elements in Scene

Discussion in 'Immediate Mode GUI (IMGUI)' started by Crew345, May 29, 2015.

  1. Crew345

    Crew345

    Joined:
    May 29, 2015
    Posts:
    6
    For example : I have already made a canvas with a few buttons, but I can't change these buttons' skin. As I understand I can only apply GUI Skin with scripting and I have to make all my canvas again in script? So the question is : Can I apply GUI Skin to made canvas without doing everything again?
     
  2. BMayne

    BMayne

    Joined:
    Aug 4, 2014
    Posts:
    186
    No,

    A GUISkin is for imGUI (Calls inside of OnGUI). The uGUI (the stuff you place in the scene view) uses textures. If you want a "skin" you just give the button a texture.

    Cheers,
     
    Crew345 likes this.
  3. Crew345

    Crew345

    Joined:
    May 29, 2015
    Posts:
    6
    And how can I change button textute?
     
  4. BMayne

    BMayne

    Joined:
    Aug 4, 2014
    Posts:
    186

    Ignore the Serialize Sprite checkbox, it's custom

    You just have to mark your texture as a sprite then drag it into your UI component.
     
    Crew345 likes this.
  5. Crew345

    Crew345

    Joined:
    May 29, 2015
    Posts:
    6
    Thank you very much!
     
    BMayne likes this.
  6. Crew345

    Crew345

    Joined:
    May 29, 2015
    Posts:
    6
    Everything had been great till I faced new problem :) When I changed Source Image of Button's Image component, Source Image was smaller than button's hitbox and now I need to make Source Image the same size as hitbox or vice versa ( I don't know ). Can you help, please ?
     
  7. Crew345

    Crew345

    Joined:
    May 29, 2015
    Posts:
    6