Forum rules - please read before posting.

Source Image from Image object (Unity UI) "glitch" after binding it to a Graphic element in a Menu

Apologies if this is going to be a long post, but I'm trying to describe the issue as thoroughly as possible. Thanks in advance!

-

I'm trying to implement a very basic "slideshow": I just want the player to browse back and forth some pages.

Basically I have created 4 Graphic elements, one for each page I want the players to browse. I've set up a Previous and Next Buttons to let them do so and linked to both an ActionList that would:
  • Check which Graphic element\page is currently visible
  • Make it invisible
  • Make the next\previous one visible
This *kinda* works, but I have a slight problem: a "glitch" that occurs whenever I turn on the Menu itself.

I figured that (or at least, I suppose) the Texture field in the Graphic element of a Menu overrides the original Source Image of the Image object of a UI.

This could also be fine, but the problem is that I can't seem to avoid the white, blank texture from appearing on the Image object for a brief moment before the Menu "overwrites" it with its own.

I tried different solutions:
  • Using 2 different menus
    • One just for the Buttons (using Unity UI Prefab - they swap sprites on click)
    • The other for the pages implemented as Graphic elements (using AC).
The reason this isn't working is described here.
  • Using Raw Image objects instead of Image ones.
They won't be imported by the Linked Image field of the Graphic element.
  • Using Object Visibility\Invisibilty instead of Hide\Show Menu Element in the Previous\Next Buttons ActionLists

I suppose it doesn't work because the Image objects don't have a Sprite Renderer

Among these, the only possible solution appears to be the first one, but I should place the Buttons-only Menu away from the Graphic-only one. I will do this if there are no other solutions, even if it's not really what I wanted this "slideshow" to look like.

I thought it was an issue with the latest Unity release (5.2.1f1) so I
patched it to the 5.2.1f1p4 version but it didn't solve the issue.

I've been banging my head on this for hours now and I'm actually afraid that this is just one of those super-silly issues, dictated just by my distraction #-o Apologies if this is the case!

Thanks a lot, again! :)

Comments

  • Does it only occur the first time the menu appears, or every time?  Does it have a transition time?  I have a feeling you could mask it by having a fade-in.

    I will look into this, but you could probably do this using animations - an Animator on your UI could be used to change the Image's sprite.  You'd only need one in that case, and it wouldn't need to be linked to AC.
  • Apparently it would occur just the first time, as if it is not "pre-compiled". Maybe I should try something to make it look like as if? Like having it happen "in background" before the game actually starts? Of course, I could also try with fade (even just for the sake of trying).

    Anyway, it does not have a transition time at the moment, also I haven't tried with animations. Have you any specific reference to share about that? If not, no problem :)

    Thanks a lot!
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.