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 Davidflynn · Apr 19, 2012 at 03:11 PM · movie

Movie Play Full Screen

In my game I am building it so that onece you complete the level it loads another scene that would be the cutscene and after the move completes it loads my next game playe. Where my problem comes in is making it so that my movie plays full screen. Currently my movie is on a plane with the fallowing code on it.

 function Start(){
     renderer.material.mainTexture.Play();
     yield WaitForSeconds(8);
     Application.LoadLevel("Boat");
     
 }
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 brumdogpro · Apr 21, 2012 at 04:56 AM 0
Share

You can try using a GUITexture for the movie file and creating a script that resizes texture based on window size

avatar image Graf-Zorba · Apr 21, 2015 at 01:07 PM 0
Share

Can both of you paste the code formatted, so that it can be viewed by other users? I'm trying to follow what you suggest, and its not very pleasant that way:)

2 Replies

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

Answer by CC Inc · Apr 21, 2012 at 09:40 PM

GUI.DrawTexture(Rect(0,0,Screen.width,Screen.height),MovieTexture,ScaleMode.StretchToFill);

then play the movie texture using MovieTexture.Play();

you may also want to set Screen.fullScreen = true;

and hide the cursor using Screen.showCursor = false;

and when Escape is pressed and released you may want to re-show the cursor and minimize the screen to its original location:

     function Update() {
     if (Input.GetKeyUp(KeyCode.Escape)) {
         Screen.showCursor = true;
         Screen.fullScreen = false;
         // in webplayer the fullscreen mode is automatically escaped when "Escape" is pressed
    }
 }
Comment
Add comment · Show 3 · 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 Davidflynn · Apr 24, 2012 at 06:59 PM 0
Share

It says no appropriate version of 'unityEngine.GUI.DrawTexture' for the argument list '(UnityEngine.Rect, System.Type, UnityEngine.Scale$$anonymous$$ode)' was found

avatar image CC Inc · Apr 24, 2012 at 10:01 PM 0
Share

Do you have Unity Pro?

avatar image Davidflynn · Apr 26, 2012 at 02:23 PM 0
Share

yes Im using and up to date Unity Pro

avatar image
0

Answer by cmos · Jun 08, 2012 at 08:19 PM

Got most of this code from somewhere else on this site. Added the part to keep the video ratio (ex. 16:9)

pragma strict

/MovieTexture VideoTexture;

var movieTexture = new MovieTexture(); var goToScene : String; function Start(){ //MovieTexture.Play(); movieTexture.Play(); while (!movieTexture.isReadyToPlay) yield; // Initialize gui texture to be 1:1 resolution centered on screen guiTexture.texture = movieTexture; transform.localScale = Vector3 (0,0,0); transform.position = Vector3 (0.5,0.5,0); print("H"+movieTexture.height); print("W"+movieTexture.width); print(1.0*movieTexture.height/movieTexture.width);
//Keep Ratio (ex. 16:9) guiTexture.pixelInset.xMin = -Screen.width / 2; guiTexture.pixelInset.xMax = Screen.width / 2; guiTexture.pixelInset.yMin = -(1.0*movieTexture.height/movieTexture.width*Screen.width) / 2.0; guiTexture.pixelInset.yMax = (1.0*movieTexture.height/movieTexture.width*Screen.width) / 2.0; //Stretch video to full screen / guiTexture.pixelInset.xMin = -movieTexture.width / 2; guiTexture.pixelInset.xMax = movieTexture.width / 2; guiTexture.pixelInset.yMin = -movieTexture.height / 2; guiTexture.pixelInset.yMax = movieTexture.height / 2;/ // Assign clip to audio source // Sync playback with audio audio.clip = movieTexture.audioClip; // Play both movie & sound movieTexture.Play(); audio.Play(); } // Make sure we have gui texture and audio source @script RequireComponent (GUITexture) @script RequireComponent (AudioSource)
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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can i use moive files or sound files without imorting? 1 Answer

Pausing a movie using iPhoneUtils.PlayMovie 2 Answers

Unity Movie Texture Audio Black Screen 1 Answer

Best method to stream large still image stream as movie-like texture 1 Answer

Want to make film... how to do this? 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