- Home /
Cutscenes in 2D
Hi,
I am trying to realize cutscenes which I want to look like animated manga. To be more precise : I am having 2D images and I want to play them using a script to make them fade one to another ( like old cartoons were made , almost ) with voice cover of course.
I am not very sure how to do this. I don't know how a fading script would look like and what should I use GUI or Plane.
P.S. UNITY FREE
Thanks for help.
FTR many people use 2DToolkit (sounds like a broken record)
with 2dToolkit this is instant, you just set the fade from one to another
TBC there's no reason at all you can't do it without 2DToolkit, it's just so much easier
Speaking of 2D Toolkit, this is a really well done plugin worth every dollar and more. The developer is investing what seems to be his entire week working on it, improving it and supporting his users. Pay the $50, you will be doing something good both for you and for someone else... :)
Answer by AMDAndrew · Oct 04, 2012 at 07:43 PM
You can add a GUI texture triggered by collider and Voila ! SlideShow or Cutscene script with 2d Images :
Script for everyone :
#pragma strict
var pageOne : Texture2D;
var pageTwo : Texture2D;
var pageThree : Texture2D;
var pageFour : Texture2D;
var pageFive : Texture2D;
var changeImageSpeed : float = 0.2;
private var swImage : Texture2D;
var changeImageTime : float;
//var voiceCover : AudioClip;
function Start () {
swImage = pageOne;
}
function Update () {
changeImageTime += Time.smoothDeltaTime*changeImageSpeed;
if( changeImageTime >= 10 ){
swImage = pageTwo;
}
if( changeImageTime >= 20 )
swImage = pageThree;
if( changeImageTime >= 30 )
swImage = pageFour;
if( changeImageTime >= 40 )
swImage = pageFive;
if( changeImageTime >= 50 )
Application.LoadLevel("Level 1");
}
function OnGUI(){
GUI.DrawTexture(Rect( 0 , 0 , Screen.currentResolution.width, Screen.currentResolution.height ), swImage);
}
Answer by Screenhog · Oct 02, 2012 at 08:50 PM
If it were me, I'd use actual mesh objects – like planes – to display the comic panels. I'd likely make a Transparent Unlit material for each unique image, changing the texture properties appropriately (Non Power of 2, for instance). The materials would be added to planes.
For animating them, my first thought would be to parent all the planes to an empty GameObject, and then animate them within Unity's Animation window, which is good enough for simple, timed motions like these. You can animate both movement and transparency in the Animation window. The animation of the comic would then be saved, played within the game, and paused/restarted based on user input (depending on how complicated your comic would be).
I am going to try this and if it will work good I'll accept this as good answer
EDIT: I found another problem, if the plane is for ex 800 x 600 and your res. is the same you'll have a full screen but if your res. is bigger the plane is smaller.
Are you working with multiple resolutions? Could you just display your comic over a black background, so that any bleed outside the comic is just black?
I'm working with 1280 but I think there will be players that will like to play with for ex 800. What will they do ?
Change the distance of the camera from the planes, possibly?
Answer by AlucardJay · Oct 03, 2012 at 06:05 PM
Aah, the joys of supporting multiple resolutions and aspect ratios. Search for similar questions about iOS and supporting multiple displays, e.g. :
http://answers.unity3d.com/questions/158934/2d-ios-game-different-resolutions-question.html
http://www.google.com.au/search?q=unity+detect+what+iOS+screen+resolution
Basically you have 2 main methods. One is to create an object with a texture that when viewed by different aspect ratios it doesn't occlude any important parts of the image. The Other is first detect what aspect ratio the build is playing in, then load one of several different objects that have each been built in their own aspects. The second requires more objects, and possibly the use of the Resources folder, so consider the first =]
Sorry, to answer the actual question, use planes and swap textures for different resolutions =]
Your answer
Follow this Question
Related Questions
Setting Scroll View Width GUILayout 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Repeat fade in and out 1 Answer
Limit on GUI Components? 0 Answers
How To Make Ammo & Realod for Gun & Spark for Gun ? 0 Answers