1
\$\begingroup\$

I am basically trying to recreate this sample image

enter image description here

from this sprite sheet

enter image description here

(Source)

I split the sprite sheet in the sprite editor of unity, now I want to use the top left texture for ground. But when I add UI->Raw Image, I cannot add the split texture to the texture source. How do I add it as a texture? In the source it does not show the split assets but the full sprite sheet.

How do I add this one single texture? That I have already split in the unity sprite editor.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Why do you want to use it as a Raw Image instead of an Image or Sprite? Populating a Raw Image from a spritesheet is somewhat unusual — typically we resort to Raw Image only for content that's generated at runtime, like RenderTextures. \$\endgroup\$
    – DMGregory
    Commented Sep 4, 2017 at 19:10
  • \$\begingroup\$ I dont know. I guess the unity game dev course I am following stated that textures are input as raw images. Is this wrong? \$\endgroup\$ Commented Sep 5, 2017 at 5:15
  • 1
    \$\begingroup\$ Depending on the context, they might have been saying that you can import any common image format into Unity, and it will handle converting it to a game-ready format. (So it's "raw" in the sense that you didn't need to do special baking steps before bringing it into your project, rather than the sense of the RawImage component) \$\endgroup\$
    – DMGregory
    Commented Sep 5, 2017 at 11:40

1 Answer 1

1
\$\begingroup\$

As the comments state, RawImage is for showing textures, but what you have are sprites (a thin veneer over parts of a texture). You'll want to use SpriteRenderers or Images instead. I would recommend sprites over images, since you are building a game scene, not a user interface. Note that both images and sprites have the ability to tile their contents.

\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .