Search Unity

How to hide parts of UI Image?

Discussion in 'UGUI & TextMesh Pro' started by squigglyo, Jul 24, 2017.

  1. squigglyo

    squigglyo

    Joined:
    May 21, 2012
    Posts:
    107
    Hey guys

    Ive spent all day looking around cant find a solution to this.

    Im following this guide
    https://www.raywenderlich.com/125313/make-game-like-candy-crush-spritekit-swift-part-4

    and adapting it to Unity. Ive gotten to the part where it hides tiles if they fall on to non-tile spots, using SKCropNode. As far as i can tell there is no equivalent thing in Unity that does what the SKCropNode does.

    Is there any information anyone can point me towards to do something to hide my tiles only when they exceed the bounds of the level?

    Not to sure how shaders work, but maybe the answer is there?
    Maybe, I need some sort of transparent object that ignores the tiles but not the background?
    Maybe another camera with that sort of logic built in to it?
    Maybe checking the bounds of tiles as they fall and dynamically turning off pixels?
    I dont know.

    Ive attached some pics to show the general setup of my tile system.
    Any help would be great.

    Images
    https://screenpresso.com/=7GBuf
    https://screenpresso.com/=BLgJc

    Video of tile movement
    https://screenpresso.com/=uyiQd