Studiocode Tutorials | 6.1 Labels & Groups - Creating Labels and Groups
In this tutorial I'm going to introduce you to labels.
In order for this to make sense you should already know what a code button is how to create it and generally how it behaves so if you don't have a sense of those please go back and watch the code button video tutorials.
You can see I already have a code button in the code window. To create a label just click and drag this label icon down into the window a similarly for sake of example if I had a code button in the window here I could double-click to open the inspector and just change the button type to a label and now it's a labeled.
A label is denoted by a circle that's the identifier here on the button itself as opposed to code buttons which have diamonds so I'll go ahead and delete this second label much like a code button.
If I double-click on a label I can give it a name here so let's just call this North and it's really important to assign labels to groups so for example I could and assign this label 2. I'm going to call the group enters so North is the direction from which the taxi is entering the intersection maybe said differently groups are categories of labels so might the idea here is.
Now that I've created this one label let me adjust quickly skip to switch to a pre-built code window here with some other labels so now i can have north south east and west and they all belong to the enters group or also you know labels are nested within groups.
Groups are the larger concept so to give you just a quick idea of how labels behave I'm going to go to code mode and I'll click on the taxi button to mark in so you know how that behaves as a code button. Now I'll pause the video here. Any time you're marked in with a code button you can click on one or as many different labels as you like.
So let's say I'm just going to imagine that there's a taxi in it intersection right now and it's coming from the north. Notice that when I click on that button and went on and off there's no marking points in the timeline.
Labels are just like tags or labels that are getting applied to the instance so let me play the video a little bit longer. I'll pause it and now I'll mark out of the taxi instance so the code button is what's being used to mark in and out. Create the row creates the instance and now if I hover over the late uh sorry if I hover over the instance itself you can see just above the number line that there is the label called North and it's part of the group which is shown or displayed in red that's enters so I'll do another one just for sake of example here let's hit play let it move along I'll mark in with taxi again and this one just for sake of example let's say it's coming from the south and then I still need to mark out of that instance and again if I hover over you can see that there's that label all that instance.
So takeaways here are that labels do not mark points on the timeline they don't create rows they are just information like additional layers of information that apply to instances and labels need to be applied to instances so for example I cannot just apply a label to an arbitrary point on the timeline.
Labels describe instances and we'll cover in other tutorials how you can apply many different labels to a given instance and all the different methods of applying labels because what I've demonstrated here isn't probably a method that you will end up using frequently but it just gives us something to demonstrate how a label would manifest it all the time.