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. Dismiss Notice

Basic sprite question

Discussion in '2D' started by ADNCG, Jun 9, 2014.

  1. ADNCG

    ADNCG

    Joined:
    Jun 9, 2014
    Posts:
    989
    First of all, sorry about the irrelevant title, I couldn't figure out how to make a short sentence out of my issue.

    Here's what I'd like to do : I'd like to have a bar with multiple icons on it at the bottom of the screen, and I'd like to be able to scroll that bar on the X axis. Though, the bar is intended to take the whole screen length, and say you move it towards the right, then the right part of the sprite should gradually appear on the left of the screen, if that makes any sense.

    Like, say the bar has A, B, C and D on it. If I move the bar(a sprite) towards the right, till the D isn't supposed to show anymore, then it should be showing on the left part of the screen. If I keep pushing the bar right, then eventually I'll see the C, the B and finally the A. English isn't my primary language, apologies but my vocab is rather limited here.

    Is there any way to achieve this that you know of? Are there any alternatives if not?
     
  2. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
    Yes, you already described how.

    You can use a quad with a repeatable texture, animating it by changing the texture offset instead of actually moving the GameObject.
     
    ADNCG likes this.
  3. ADNCG

    ADNCG

    Joined:
    Jun 9, 2014
    Posts:
    989
    Oh that's clever, thank you very much