Forum rules - please read before posting.

How to have a Button switch textures on click, without fading?

Hi there!
I'm new to the Adventure Creator asset, so apologies if this has an easy solution or it has been discussed once already, but I couldn't find any related issue in the previous discussions.

I'm trying to get a Button in a Menu switch textures once the player clicks on it, then get back to its original texture after the click has been processed.
This is what I'm getting so far:


I can't seem to find a way to avoid its fading effect, also I noticed that the Background Texture (which is set to the "default" state of the button) is always visible, even when I click on it. Am I missing something?

I'm using the Background Texture field for the "default" state (and I guess this is part of the issue) and Click Texture one, of course, for when the player clicks on it.

I thought of using a Toggle, instead of a button, but it's not really what I want to achieve.

Thanks in advance and congratulations for the amount of work put into this asset.

Comments

  • use None appear type instead of fade.
  • edited October 2015
    Actually, I wish I could have found something like that for Button elements specifically, but it seems that I can only set the Transition Type for the whole Menu.

    The only Appear Type I can see is the one in the Menu properties which is not related to fading,
  • edited October 2015
    Works fine for me I have menus with some backgrounds and buttons in it and other graphic elements too and only buttons do highlight. Oh btw I just checked, I have Appear type fade with transition time zero and transition animation liniar. Otherwise you'd need to create a seperate menu with your buttons or Unity Ui Prefab with custom scripts. That's all I know of.
  • You could either "cheat" by having a separate Graphic element appear for the duration (the Menu: Change state Action allows you to hide/show individual elements, or by switching to Unity UI as your Menu's source.

    With Unity UI, you can fully control the animation of any button when clicked on - and so is much more powerful in that regard.  Merging a Unity UI with AC is very simpe - see this tutorial.
  • Thanks a million to both of you.

    I ended up using the Unity UI Prefab feature as Chris suggested and seems to be working like a charm! :D
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.