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 UnrealIzzy · Sep 08, 2012 at 03:03 PM · guicredits

In Game Credits?

Hi Guys, So I Have nearly finished my Main Menu GUI Screen! But I would like to add a credits scene.

So I have already made the code so when the player clicks the Credits button it loads up a separate scene but I can't work out the script to make the actual credits e.g Created by... (then next line) Music by... etc.

  • That way I will be soo close to finishing the main menu screen :D Thank you in advance to anyone who can help! -Izzy

Comment
Add comment · Show 6
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 UnrealIzzy · Sep 08, 2012 at 03:19 PM 0
Share

Yeah True. I will not be spending loads of time on these small features but once I have Finished the levels $$anonymous$$enu etc.. I might just add them in.

Thanks anyways

avatar image reptilebeats · Sep 08, 2012 at 03:30 PM 1
Share

i dunno i think companies are starting to add more into the menu, maybe not in mobile games but i have found more games putting the instruction booklet in the game ins$$anonymous$$d of in the box, and the way games are going we will see more of this.

i can see how if there is a lot of people working on a game it can be annoying, but for a small $$anonymous$$m it only takes 20 $$anonymous$$utes.

put your entire credits into one gui element and move the gui up past the camera viewport that renders gui, nothing fancy but its only credits

avatar image UnrealIzzy · Sep 08, 2012 at 03:32 PM 0
Share

yeah I just think It would help out the people that helped me make the music etc..

Thanks anyway :D

avatar image Screenhog · Sep 08, 2012 at 04:59 PM 1
Share

Omit the credits because most people don't care about them nowadays? When have people ever really cared about the credits? On movies, on TV shows, on a CD... you don't do it for the customers, you do it to recognize the people who helped work on the game.

That said, there are ways to make credits more interesting. The Incredibles had a great end-credits sequence, and Scribblenauts had a good one too.

avatar image UnrealIzzy · Sep 08, 2012 at 05:14 PM 0
Share

Yeah they do :D

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by robin-theilade · Sep 20, 2012 at 04:42 PM

This very simple credits scroller should get you started.

 using UnityEngine;
 
 public class Credits : MonoBehaviour
 {
     private float offset;
     public float speed = 29.0f;
     public GUIStyle style;
     public Rect viewArea;
 
     private void Start()
     {
         this.offset = this.viewArea.height;
     }
 
     private void Update()
     {
         this.offset -= Time.deltaTime * this.speed;
     }
 
     private void OnGUI()
     {
         GUI.BeginGroup(this.viewArea);
 
         var position = new Rect(0, this.offset, this.viewArea.width, this.viewArea.height);
         var text = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 Quisque a mauris sit amet neque posuere molestie at laoreet lorem.
 Suspendisse accumsan pretium ante, sit amet tincidunt tortor tempor ac.
  
  
  
 Sed condimentum mi id nisi egestas non vulputate urna porttitor.
 Mauris sed mauris vitae velit imperdiet vulputate ut nec velit.
 Maecenas convallis posuere velit, quis interdum justo mattis vel.
  
  
  
 Aliquam hendrerit ullamcorper dui, a laoreet dolor ornare sit amet.
 Praesent sed odio purus, a convallis tellus.
 Nulla porttitor arcu vel ipsum luctus euismod.
  
  
  
 Duis tincidunt vehicula nisl, nec venenatis velit convallis non.
 Sed semper metus egestas libero venenatis imperdiet.
 Pellentesque venenatis orci nisi, vel fringilla dolor.
  
  
  
 Nam at lacus massa, commodo pellentesque velit.
 In accumsan velit sed nisi aliquam tristique.
 Ut eu quam tellus, eu egestas diam.
  
  
  
 Maecenas vel dui vitae orci accumsan molestie.
 Donec pulvinar metus nec turpis rutrum quis gravida ante dignissim.
 Ut quis justo quis nisl eleifend ornare non at ipsum.";
 
         GUI.Label(position, text, this.style);
 
         GUI.EndGroup();
     }
 }
 




Use the style to make the default font larger (about 24px?), change the color so the text is visible on your background and set the alignment to Top/Center.

Good luck with it.

Comment
Add comment · Show 7 · 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 DyrdaOrg · Oct 10, 2013 at 06:34 AM 0
Share

Hey:) I know it's old but I found it very useful - can't "cut it" to the part of screen (I've got buttons and logo and those credits go right through them). Could you please help?

avatar image robin-theilade · Oct 10, 2013 at 01:23 PM 1
Share

I have updated the example above with a RECT that will define the position and size of the credits area.

avatar image Rxanadu · Jan 10, 2014 at 06:52 PM 0
Share

I'm using your script as a simple way to implement credits in a sample game for others to use for free. However, I'm unable to line up the position rectangle so the text appears below the screen and moves upward until the game detects the text has moved above the screen. I'm specifically trying to make it work out of fullscreen. I'll explain that later in this post.

The only thing I've done to your script is make the viewArea Rect object into a private object and give it the dimensions of: new Rect(0, 0, Screen.width, Screen.height)

I assumed the Screen.height would allow the offset to be placed at the bottom of screen, as Screen.height is the height of the screen in pixels. The value is the lowest value in the y-axis in fullscreen. However, this value does not work outside of fullscreen, and I have yet to find a way to make the credits work outside of fullscreen mode.

TL;DR: Do you happen to know of any way to make your credits script work while the game is windowed?

avatar image robin-theilade · Jan 10, 2014 at 08:14 PM 1
Share

@Rxanadu The solution you're describing works for me. I added these lines of code to the beginning of the Start method, before the initial offset is set:

             if (this.viewArea.width == 0.0f)
             {
                 this.viewArea = new Rect(0.0f, 0.0f, Screen.width, Screen.height);
             }

I tested by building a standalone Windows build and switching between fullscreen and windowed using Shift+Alt+Enter while it was running. Does it work for you in fullscreen? If so it should also work in windowed. The width and height of the Screen class actually refers to the boundaries of the game screen and not the whole desktop.

avatar image Rxanadu · Jan 10, 2014 at 11:38 PM 0
Share

It does indeed seem to work. I've tend to test everything out in the editor before building it, so it tends to look odd when testing the game.

Thanks for the help.

Show more comments

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

14 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

Related Questions

Multiple Cars not working 1 Answer

Customizing GUI buttons 1 Answer

ignore left mouse button click in game when clicking on gui buttons 1 Answer

GUI Button to a GUI slider help ? 0 Answers

How To Make GUI Buttons Load/Quit 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