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
1
Question by Dylan Cristy · May 13, 2011 at 04:28 PM · guitexturezoommovietexturepixelinset

Is there an issue when playing a Movie Texture as a GUITexture?

Hi,

I'm having a problem playing a Movie Texture as a GUITexture. I'm using GUITexture instead of throwing the movie on a game object because I want it to be a full-screen cut scene kind of thing, rather than an in-game effect. I'm building for OSX standalone, with a fixed window size of 1024x768, and the movie (.mov) is 1024x768. When I make a build and play it, even though I set the GUITexture pixel inset to (0, 0, Screen.width, Screen.height), it plays the movie as though it is zoomed in towards the center. That is to say, it's as if it's playing the inner 800x600 pixels of the movie (based on the center point, and those are just guessed dimensions), stretched to fill the 1024x768 window. And other than this odd zooming, everything else works as I would expect it to.

Here's my code...

// variables exposed in inspector to assign the movie and audio var introMovie : MovieTexture; var introMovieAudio : AudioClip; private var gTex : GUITexture;

function PlayIntroMovie () { moviePlaying = true; // flag for external use if (audio.isPlaying) audio.Pause(); // pause regular background music

 gTex = gameObject.AddComponent(GUITexture);
 var movieAudio : AudioSource = gameObject.AddComponent(AudioSource);
 movieAudio.clip = introMovieAudio;
 movieAudio.volume = .4;
 movieAudio.rolloffMode = AudioRolloffMode.Linear;
 gTex.enabled = false;
 gTex.pixelInset = Rect(0, 0, Screen.width, Screen.height);
 gTex.texture = introMovie;
 gTex.enabled = true;
 gTex.texture.Play();
 movieAudio.Play();
 while (gTex.texture.isPlaying) yield;
 gTex.enabled = false;
 Destroy(gTex);
 Destroy(movieAudio);

 audio.Play();  // restart background music
 moviePlaying = false;

}

Anyone have any idea why this might be happening, or how I can fix it?

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
Best Answer

Answer by Bunny83 · May 13, 2011 at 04:47 PM

Did you set the localScale to 0,0,0 like the docs on GUITexture.pixelInset suggest? Also after setting pixelinset don't change the transform.

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 Dylan Cristy · May 13, 2011 at 05:01 PM 0
Share

I had overlooked that. Thanks, did the trick.

avatar image michela · Jul 07, 2011 at 12:27 PM 0
Share

Should this work on an iOS build?

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

1 Person is following this question.

avatar image

Related Questions

Scripting GUITextures Issue 6 Answers

GUI on iPhone...GUI.DrawTexture or guiTexture.pixelInset ? 1 Answer

Fade script working but I can't 'see' it working? (Solved) 1 Answer

click to skip intro video 1 Answer

Relative GUI positioning and Pixel Inset/Offset conversion 2 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