Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Determined · May 01, 2017 at 03:23 PM · uimaskminimap

How to clamp icon in minimap's border when the minimap shape is random?

Hi,

I am working on minimap. I was able to clamp the distant icons in the minimap border when the minimap shape is Rectangular or Circular.
I am searching for a way to clamp the icons in the border in case of different shapes like the attached image.
I've used Unity's default UI Mask for creating different shaped minimaps.
I was thinking, if I could detect the edge of the Mask image according to alpha value and clamp the icons in the edge. But couldn't find any way for it. Any suggestion is appreciated. Thanks in Advance. alt text

minimap.png (241.3 kB)
Comment
Add comment · Show 2
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 ZackMan12 · Oct 17, 2017 at 04:44 AM 0
Share

Hey, this isn't an answer but how are you able to clamp icons on a circular $$anonymous$$imap?

avatar image Determined ZackMan12 · Oct 17, 2017 at 05:20 AM 0
Share

You can follow the above method, I mentioned above. To be precise you can: 1. take a Circle Collider 2D around your $$anonymous$$imap(Black circle in the attached image). 2. raycast from the out of $$anonymous$$imap icon(start in the attached image) to the center of the $$anonymous$$imap(red circle) 3. $$anonymous$$ove the $$anonymous$$imap icon from it's original position to raycast hit point(green box in image) from step 2. https://imgur.com/a/CiNba

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Determined · Aug 04, 2017 at 09:45 PM

I was able to solve the issue. So, writing it down here, in case anyone needs it.
I tried using RaycastMask and was able to solve it.
However, it was not optimised at all, checking pixel by pixel if the alpha was > 0.
So, I came up with an idea using polygon collider and it worked much more efficiently.
1. I raycasted from the out of minimap icon(red icon in the image) to the center of the minimap(green icon).
2. Then detected the point where it hit the polygon collider.
3. Changed the position of the out of map icon to this hit point.

In case anyone is interested, my minimap plugin is now available here:
https://www.assetstore.unity3d.com/en/#!/content/91675

alt text


screen-shot-2017-08-05-at-32900-am.png (114.9 kB)
Comment
Add comment · 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

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

138 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

[UI] Is it possible to have certain elements ignore the parent mask? 1 Answer

Problem UI masking in google vr 2020, unity 2020 0 Answers

Working on a character selection screen and trying to get a shader/mask over the characters for a locked look. Looking for help on the approach. 0 Answers

How do I apply a mask to a slider fill so it uses my quadrilateral design 0 Answers

Dynamically hide Images under another Image 1 Answer


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