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 ChrisTylr · Oct 09, 2013 at 05:14 PM · guitextureimagescoreparsing

Displaying final score using image textures

The title may not explain very well what i want so i will clarify.

Basically at the end of my game a new scene will load, and a script holding my final score 'will not destroy on load' so that i can get the score value and display it on screen. This works absolutely fine, however in my uni class today my tutor mentioned something about 'parsing' and using this he says i can take each individual digit of the score and replace each digit with a corresponding image.

For example, if my score is 1234 then i can take the number 1 and link it to an image of a number 1, and so on, so that when my game ends i have four images displayed on screen to make the total score. This should change on every run when the score changes too, and still be true to what the score value actually is.

So my question is, how would i go about doing this, until today i didn't know this was possible but i am intrigued by the idea. A few other questions i have is where would i place the code? would it be in the same script holding my final code, or in another script that i can link to the final code script, and also will i be able to position the numbers easily like i can a GUI Label, and would this involve generating co-ordinates for each number?

Thank you in advance for any replies i may receive on the matter

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 ayrton_adiong · Jan 31, 2014 at 11:36 PM 0
Share

Hello there, can i see your codes?please, you already have the solution to our problem, we dont need the score to be image. pLEASE

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ShadoX · Oct 09, 2013 at 06:18 PM

One way would be to load the images as textures and display them via GUI: http://docs.unity3d.com/Documentation/Components/class-GuiTexture.html + http://docs.unity3d.com/Documentation/ScriptReference/GUI.DrawTexture.html

where you would have to specify the coordinates and size of the texture to make sure that the result is displayed correctly on the screen.

Another way would probably be to just load plane objects with the texture and display them accordingly. (pretty similar to how the GUI would work)

I'm just not sure which 1 would be better in terms of performance.

As for the score. I would probably just write a method/function which takes the score as parameter, analyzes it(for example,check all digits (with a for cycle , for example) to find out how many images and which ones you'll need to display) and then displays the result.

Sorry for no practical example, but I don't have access to Unity at the moment.

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

17 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

Related Questions

Change slection grid content texture size/scale 0 Answers

3D ^ Custom GUIText/Label or Making a Score System without using GUI? 0 Answers

Assiging an Image to a Button 1 Answer

What's the best way to incorporate dynamically loaded textures into GUI controls? 1 Answer

How can I resize an image and save it to disk ? 6 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