Search Unity

How to split a spritesheet programatically?

Discussion in 'Scripting' started by alexandros356, Oct 20, 2016.

  1. alexandros356

    alexandros356

    Joined:
    Dec 3, 2012
    Posts:
    105
    Hi guys,

    I have to do a memotest and I have the spritesheet in the CDN. I download the file but I don't know how to split the spritesheet into the sprites I need to create the memotest.
    I need a little help with that

    Thanks in advance
     
  2. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    What is a memotest? And the CDN?
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I'm curious about that too! But to your question, you can use Sprite.Create to create a sprite out of any rectangular portion of a texture (such as your downloaded spritesheet).
     
    Kiwasi likes this.
  4. alexandros356

    alexandros356

    Joined:
    Dec 3, 2012
    Posts:
    105
    I'm sorry.. memotest is a memory game where you have to match the same pieces. And the CDN is the Google cloud platform. I have all the assets in the cloud and the app download it from there.

    I used Sprite.Create and it works fine. Thank you!
     
    JoeStrout likes this.