Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
This question was closed Dec 24, 2014 at 02:27 PM by hav_ngs_ru for the following reason:

Question is not actual anymore

avatar image
0
Question by hav_ngs_ru · Jun 27, 2014 at 07:07 PM · guiguitextureborderstretch

Is it possible to stretch a part of texture in GUI ?

Unity GUIStyle has a good thing called Border, but it can make a non stretching a part of texture only at EDGES of texture.

Is it possible to make vice-versa - to make some area in CENTER of texture non-scalable, and stretch an edges of texture?

The goal is to make a semitransparent texture with a "hole". This texture should hide other GUI elements and make visible just a little area below the hole. I use GUI Label with custom GUIStyle to show this texture. Because the hole will appear in any part of screen (and other part of screen must be hidden by texture), I have to make the Label with the size twice larger than screen (to cover all screen even when the hole is at the any edge of the screen).

And now I have a dilemma: I have to make texture size unreasonable large (about 4000x4000 where critical part - is a "hole" about 100x100 with soft edges, and other is just solid grey color) to have fine picture of a hole.

But maybe there is a way to make texture smaller? For example - to make 128x128 texture and use 100x100 pixels for "hole" and 14 pixels for each border (with solid color). But the question is HOW to display a hole pixel-to-pixel and a border - stretched to whole screen?

P.S. I know that I can make a plane or a mesh and solve the stretching problem with UV-cords, but I have to hide a GUI elements with this texture.

Comment
Add comment · Show 1
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 hav_ngs_ru · Jun 28, 2014 at 11:10 AM 0
Share

tried to make 2 textures - one small but stretched to make a large solid fill (with square "hole" that should be filled by second fine texture), and second texture to make fine "hall" with soft edges (not stretched, pixel-to-pixel). When the textures are opaque - it looks O$$anonymous$$ (second hides ugly edges of hole in first texture, and they both are just 128x128, as I wish), but when they are 50% transparent - the edges of first textures becomes visible, and it looks ugly :(

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

21 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

Related Questions

Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer

getgui joystick's guiTexture's furthest borderfrom its default position 0 Answers

Creating GUITexture with a reference 1 Answer

Activate GuiTexture When Clicking on BoxCollider c# 1 Answer

WorldToScreenPoint returns the same value when facing the opposite direction. 0 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