Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Screen Transition Unity 4.6

Discussion in 'UGUI & TextMesh Pro' started by Spabbage, Feb 15, 2015.

  1. Spabbage

    Spabbage

    Joined:
    Feb 15, 2015
    Posts:
    37
    What I would like to do is have a main screen and when a button is clicked transition another screen over the top of this one. The second screen should be on the left edge of the main screen with a tab from the second screen just showing on the main screen. Both screens should fully match the screen size for any device.

    The problem I've come across is I have the canvas scaler set to match height as the game is landscape. I want to set the second screen to scale fully to screen size whilst also anchoring itself to the left side of the main screen. I can set the anchor to where I want or match the screen size. I can't see any way to do both.

    I'm sure there'll be an easy way to do this I just can't think of one.

    Thanks.
     
  2. Spabbage

    Spabbage

    Joined:
    Feb 15, 2015
    Posts:
    37


    Hopefully this helps visualise the problem
     
  3. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,688
    The example in the UI Samples asset have a pretty good example of using multiple "forms" in a UI design, probably worth checking that out first.
    https://www.assetstore.unity3d.com/en/#!/content/25468

    However I'm not sure how a multiple monitor setup would affect this (If I read that right)
     
  4. Spabbage

    Spabbage

    Joined:
    Feb 15, 2015
    Posts:
    37
    Thanks. I will have a look into this and post anything I find here.

    :)
     
  5. Spabbage

    Spabbage

    Joined:
    Feb 15, 2015
    Posts:
    37
    By looking through those example, messing around with and animating the anchor points I think I've found a reasonable way around this.

    Position the second screen with anchor points X(0.5, 0) Y(0, 1) allowing the right hand edge of my second screen to stick to the left hand edge of my main screen. In the animation that brings the second screen on top of the main screen animate the anchors to X(0, 1) Y(0,1) to stretch the UI to fit the entire screen. The screen size has to anim from it's default size to screen size in this transition which looks slightly off but It's much better than not being able to do it.

    Hopefully this answer helps anyone else who has this obscure problem.