hello and welcome to part 5 of the kart RPG tutorial for unity with scriptable objects I am Krassin Stein and we're about to get into the configuring the UI and making it all setup we're gonna be adding in the draw pile of the score pile sifting everything through the card manager let's get started the first thing we're gonna do is we're gonna first off change the name of the canvas to game UI that we know what's going on there we need to delete the card we're going to be instantiated the card instead so let's get
this out of here Bing BAM gone so inside the game UI we are going to create a couple empty objects well so we're going to create empty but you can just right click here and cran create empty or go to create create empty and we're gonna name this drawl container and it's gonna be the spot where all of the cards sit when in in the draw pile so the first so is we're actually going to move it way off screen you can do one of two things with that neither biggest it you can either hit
w or up here for the trend for the move tool and throw it to the side off screen or to make sure that you're off screen you can do negative 2000 this just takes away off screen we're gonna make the container that holds the cards in your hand and that's gonna be called the current hand and care basically what kind of happens are going to be there's going to be cards that move from the draw container in to so it'll be child's tugs so there will be children of the draw container so they look like
this basically right you'll see a bunch of them and then as they move to your hand they're actually leave the transform or the parent drawl container and move to the new parent but actually go here instead and that'll be how it moves to the system it will go draw all current and discard so the current hand container is going to sit we're going to gonna keep it centered we're gonna move it to negative 340 it's a little bit lower on the screen basically it's going to be eighteen hundred and fifty and with 310 we're also
going to add in a horizontal layout to add component horizontal layout group we don't need any padding at all but the space thing we need is negative 20 we want them to overlap each other just a tiny bit in middle Center force expand only height we don't want it to force with it'll make it look really goofy we're gonna grab the prefab pull the card in on the current hand container there it is right there in the middle that's a pretty spot right and if you add more if you hit control D to duplicate it
it's how it's gonna layer itself like seven eight nine ten ten cards that's what lefty maxint the hands gonna be right so we put four the card manager is a max hand size of ten so let's remove all of these I was just fooling you know let's just leave one in there maybe one of theirs nice you can see what's going on then as things go okay so let's make another empty called the discard container discard container is going to sit 1400 or 1500 off of excess remember it's nice just be off-screen it needs to
be as far as possible right that's that that one's done and now we just need a couple more containers that we're not gonna worry now we need to put in the actual images for the drawing discs are vile right remember we have the sprites for them here's the discard pile sprite and then draw Palace parade if you pull this this window up you can see what it looks like oh let's take care of that we're gonna another we're gonna do a UI image to hit f2 change the draw pile and we're going to position it
first off we're gonna put the anchor bottom left and we're going to position it at 100 by 474 mooo 192 192 now when you actually need to put an image in let's put in the drop get right on boom Rahl was pretty good we're gonna do it again we're gonna do it again for the discard pile but because we already have this kind of app a little bit we're gonna do it again let's describe how before we do that we need to add how many cards are left in the deck so we're gonna right click
on draw pile UI text we're gonna Eames the text theme using f2 account and we're gonna put in a placeholder number to the 99 sit in the center of of that image that's with the center anchor is maybe negative five and eight on the Y possession and 45 and width and 43.5 in height to the bold number we're gonna pick a nice green color for it too then we got a quick best fit and middle middle first so we want a middle alignment completely and then we also want to add in a shadow so add
component shadow we're going to keep it how this is except what we're going to make the alpha I never sent but face it all black Oh shadow on and off you can see how how much more vibrant it makes it how much easier it is to read on that gray now that we have that all set up we can hit control D on draw pile to duplicate it then this new one discard file change the anchor bottom right change the exposition to negative 122 even 474 is perfect same sizes there's no change anything there we're
just going to change the image to discard pile there we go we're gonna also change the color for count this for this count we're gonna change the color ooh like a reddish color give it a give it me a bright red be a reddish orange Kanna like pedaling that isn't bad then readable all right and now we need to add one more thing but now we have all of these right right clicking game UI again we're gonna do it create UI button that button is really cold gonna be called ends turn button that button is
going to be bottom right anchored and we're gonna do negative 221 by 325 be 250 in width and 75 it's fine with the sprite it has we can add a text component which is already here as part of the button I'm going to call it end turn all capital letters make this best fit it's already aligned Center which makes it easier for us there you go there's your basic the basic game UI part to set up the user UI so we're gonna make a new canvas so here to create UI canvas we're going to call
it user UI yeah I get overtime drag it up here and what that's gonna be is it's gonna be a bar up here that gives you details about your health your stamina any trinkets you have any status effects you've got going on no inside user UI first off we need to make sure that it's set up the same way as me game UI so scale with screen size 1920 by 1080 match with her height by 0.5 and it's gonna get a script on here cuz the UI manager and that's that'll be coming in that the
next video in a uii panel I call it background background sits 925 up on the bottom and we're going to make it you we are going to make the color balance year well it a darker darker gray with full opacity we're gonna add a shadow' to it and make things pop a little bit more so it's gonna be a white shadow at full opacity and it's going to be an effectiveness of 1 negative 5 look at that it's like a border so the next thing we need to do is we need to create a UI
text object it's going to be fall of HP and it's exactly what it is it's actually HP : b14 font size center-aligned right put it in the top left anchor sixty-five and X negative 19 why 1:36 37 and width and 121 única where is it well if you click on this and then put your mouse on HP put your mouse over the scene hit F those who air it is it just needs to change the color let's see how the color is to be bright white but why is it up in that corner in your
desk the question click along the anchor projects hold alt and shift and click the top-left snap it snap everything the pivot and the position to the top corner and then change the X back to 65 and negative 8 now what's in a visa need another text we're gonna control D or to call this health info we're going to make this 146 by nine by 18 we makes a 180 in with any 121 we're gonna put in a placeholder so it'll be nine nine nine out of nine nine nine make the fun a little bit larger
maybe 50 for the font instead of 40 just so it's state pops a little bit more we're gonna make it a lighter red color it'll be something like this Zumba so now we're controlling D again to get a blot next we're gonna stuff everything we need a setup we got the block text next it's going that's going to be at 65 by negative 99 it's gonna be 305 and width and 39 weirdo font sizes point will make it bold exhale we're gonna give it a nice light blue color nice pretty light blue like that we're
gonna call this in capital letters locked : 999 I'll show how much black damage we have we actually don't take that damage and then we'll do one more and that'll be stamina text stamina text nests 300 the to negative 18 and a width of 443 and 121 we're gonna cause for the next we're gonna use stamina olan 3/3 it's going to be size 14 in bits in you and of course brightly you and there we go we've set up the user UI we've set up the game UI let's attach the things we need to the
Karma so we need the draw container drag that on to the car manager I mean the this car comes in here and the current hand container or the Cardinal does I needed to be in there we also need the UI for the draw pile those here the discard pile count goes in the discard pile and the intern button everything's now synced up for the car manager so effectively it should draw a bunch of cards for us let's find out there it is it does draw it draws five areolas now it doesn't set the cards up
so all we have to do now is very very simple open the card manager and we're going to set the data to the card dater we're going to go GU got getcomponent card dot card data equals current available cards at a specific position hi so it goes through and cycles all the cards and then also will you do a G name will name the game on Turkey type it component card dot card data dot card name there we go now it's now good to go for that now it should we just draw carts let's go
back to the unity editor if we get rid of all right so see if this works so he's got to hit the play button and there we go we have five cards already already drawn the aerial flip smack defend defendant smack and they fill out all their information correctly we have two cards in draw pile we've got the five cards in the current hand for a total of seven cards in your deck and that's and it shows all three cards that exist here you're good to go so the next video we're going to work on
the user UI we're gonna make that sink up and we're gonna learn how to discard card thanks for watching guys I really hope you enjoy this we are working on finishing this tutorial by the end of the year or 2018 I look forward to all these videos coming out rarely so relatively soon and I hope you guys have a great day yeah