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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

2D Tiles sprite texture size

Discussion in '2D' started by pankhard159, Feb 10, 2020.

  1. pankhard159

    pankhard159

    Joined:
    May 14, 2018
    Posts:
    13
    Hello,

    how can I change size of texture in sprite? Except changing size of image saved on disk.
    Img Link: https://imgur.com/a/tFFD97O

    I'm using Tiles in my project and if I apply a image to tile palette and then I will use the tile from tile palette on playground (image 1). Everything is as expected. Then if I load an image to and create a sprite and then I will apply it to all tiles on playground the result is image 2 and not like on image 1.

    Code:
    Code (CSharp):
    1.  
    2. Tile t = ...
    3. t.sprite = img.sprite;
    4. ... update tile and refresh...
    5.  
     
    Last edited: Feb 10, 2020
  2. pankhard159

    pankhard159

    Joined:
    May 14, 2018
    Posts:
    13
    Solved: I was using plain image in Tile. The RuleTile makes the magic which is needed in this problem.