Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by xevierh · Jul 06, 2015 at 04:29 AM · texturespritevectors

How can I make a simple sprite that I can stretch for different platforms?

Hi. I'm currently working on a platformer where all the platforms are styled with outlines like this: alt text

All the white is transparency btw.

These boxes make up the platforms which obviously need to be different sizes. The problem is, I don't know a good way to stretch a simple image like this without distorting it.

Does someone know a simple way that will let me replicate this look on multiple game objects of different sizes?

Please and thank-yous.

example.png (284 B)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Umresh · Jul 06, 2015 at 05:49 AM

Use the following settings alt text

alt text


screen-shot-2015-07-06-at-111751-am.png (47.2 kB)
screen-shot-2015-07-06-at-111822-am.png (33.7 kB)
Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image xevierh · Jul 06, 2015 at 07:47 AM 0
Share

I'm sorry, i'm grateful for the simple fix, but i can't seem to get this to work. I've set up the image as as sprite and edited in the text editor. And then I made an empty game object and gave it he image (script) component which gave it the canvas render and the rect transform. Then i filled all the settings in.

But i can't see anything. If it helps, nothing is inside the image in the top left of the rect transform. Ins$$anonymous$$d of a green square holding a grey square that has the move compass symbol in it, i just see nothing in that box.

alt text

alt text

recttransform.png (320.2 kB)
sprite.png (325.3 kB)
avatar image fafase · Jul 06, 2015 at 08:01 AM 1
Share

For your object to be considered as a UI item it needs to be under a canvas object.

Remove your GameObject from the scene. Go to the menu at the top, GameObject -> UI -> Image.

This will add all the necessary objects (Canvas, Image under Canvas and EventSystem). Then in the Image component of the Image, you can add the sprite.

avatar image xevierh · Jul 06, 2015 at 08:34 AM 0
Share

Ahhh thank you very much! Solved all my issues. Sorry, i'm still a little new to some aspects of unity.

avatar image xevierh · Jul 07, 2015 at 04:38 AM 0
Share

Never$$anonymous$$d. This was not helpful to me at all. As I said, these are for platforms, of a platformer. As in they cannot be UI elements.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Sprites and textures appears black on Samsung Galaxy Grand I9082 0 Answers

Texture type -> Advanced -> Mesh type: how it works? 1 Answer

Unity 2018 UGUI Android Sprite Textures Not Rendering Correctly 1 Answer

Draw some vectors over a sphere, just like latitude and longitudes with the help of 2D texture 0 Answers

How to remove gaps in a repeating texture? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges