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 /
avatar image
0
Question by 1337GameDev · Jan 25, 2012 at 07:33 PM · cameraguirtsminimapicons

RTS minimap (mobile but still taking all ideas)

I am curious how i should go about making a minimap. I want to represent the whole battlefield and units as icons based on type. How would i go about doing this? I know i could have a second camera and then make a gui icon above each object that is only rendered for the minimap camera, but how would i then get them to scale? Would this be inefficient on mobile devices? (tegra 2 tablets)? How would i set up a second camera and render it to a texture anyways? How would i also accommodate for enemies units being same guiIcons, but red instead?

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
1

Answer by Tasarran · Jan 25, 2012 at 08:45 PM

That's more than one question, you're disqualified! Just kidding; I'll try to take these in order, I'm working on the same sort of thing myself right now.

In the minimap, your icons would all be the same size, wouldn't they? That's the way I visualize it working. You just create the icons at the size you want. When you display GUI elements, you specify what size they will be.

I can't speak to the specifics of mobiles, I've only been developing for PC/Web so far.

As far as the different icons, I'd just create red versions of the icons at the same time as I made the green ones. If you're using PhotoShop, you can adjust Hue/Saturation/Brightness in one command, and make multiple variations of the same icon. Then I'd use a Skin for each color. You could squeeze as many versions as you want in one skin by using the Custom slots, but if you make one skin and set it up the way you want, you can just Duplicate it and swap out the textures for the icons.

Then, just before you display an element, you can have a command (this is of course, in your OnGUI function):

GUI.skin = GreenIcons; (Or RedIcons)

You can have an if or switch statement to check a variable on the unit to switch between GreenIcons and RedIcons.

Comment
Add comment · Show 2 · 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 1337GameDev · Jan 25, 2012 at 08:57 PM 0
Share

hmm, couldn't i modify the icons in code by adjusting color values in unity itself? (I want to cut down on package size). How would i display these icons? I don't want to necessarily use gui elements if i don't have to (it might get buggy with small movements. How would i display a certain camera to render to a texture?

(Sorry about multiple questions, just fits under this idea and thought process)

avatar image Tasarran · Jan 25, 2012 at 10:06 PM 0
Share

You could make all your icons in a white/gray color scheme, then use GUI.color to shift them. I'm pretty sure you can use that the same way you would shift skins, but I don't have any experience using that yet.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

resetting the my default value for camera field of view 1 Answer

Can the Camera be Positioned on the Game Screen through code? 0 Answers

How do I attach a Camera to a GUI (for a Mini map) 4 Answers

Getting Camera View (Mini-map) 0 Answers

Minimap camera display size. 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