1
00:00:01,000 --> 00:00:06,570
All right, in this lecture, I'm going to show you how to use the on off switch angiosperms.

2
00:00:07,470 --> 00:00:09,490
Let's start with a little example.

3
00:00:09,520 --> 00:00:17,130
I'm going to take this switch node from the dashboard collection and drop it onto my compass and to

4
00:00:17,130 --> 00:00:19,170
display the state of the switch.

5
00:00:19,200 --> 00:00:25,230
I'm going to use a text output node just like this, connect the two.

6
00:00:26,170 --> 00:00:32,970
And as usual, let's create a new tap in which I'm going to put the switch and then you text output.

7
00:00:33,360 --> 00:00:42,840
This time I'm going to use the layout tap in the dashboard, tab in the right side toolbar to create

8
00:00:42,840 --> 00:00:43,710
a new group.

9
00:00:43,740 --> 00:00:47,610
So here I am in tap one I've got already group one.

10
00:00:47,610 --> 00:00:56,160
I'm going to add one more group and then edit it and call this one switch group.

11
00:00:59,300 --> 00:01:06,850
On the top to sorry, step one, let's leave it in step one and for its width, let's make it five,

12
00:01:06,850 --> 00:01:11,470
since we are only going to have a couple of small components in it and update.

13
00:01:11,470 --> 00:01:20,170
And now that we've got the second group on the tab, one is got into the switch, edit pain and allocated

14
00:01:20,170 --> 00:01:22,750
into the switch group right here.

15
00:01:24,840 --> 00:01:27,240
I'm going to give it a size of five.

16
00:01:28,050 --> 00:01:36,740
Take the whole width and leave the default icon and then for the what happens when you click on it or

17
00:01:36,750 --> 00:01:38,630
either enable or disable the switch.

18
00:01:38,820 --> 00:01:39,970
You've got plenty of options.

19
00:01:39,970 --> 00:01:46,380
So, of course, the default they suggest send out boolean values, true or false, the way that this

20
00:01:46,380 --> 00:01:52,050
works by default is that when the switch is on payload, it's going to have the boolean true value and

21
00:01:52,050 --> 00:01:59,400
when it's switched off, it's going to have the boolean false value or you can just send it other types

22
00:01:59,400 --> 00:02:00,030
of payloads.

23
00:02:00,110 --> 00:02:04,410
For example, you can send it a string.

24
00:02:04,470 --> 00:02:06,630
You can say hello when the.

25
00:02:07,980 --> 00:02:15,550
Switches turned on goodbye when it's off or send numbers or Jason or whatever else you want.

26
00:02:15,570 --> 00:02:24,660
I'm just going to go with standard boolean values and force for when the switch is turned off.

27
00:02:25,190 --> 00:02:25,530
Right.

28
00:02:26,190 --> 00:02:28,110
Click on Done and then for the switch.

29
00:02:28,330 --> 00:02:29,010
Nothing fancy.

30
00:02:29,010 --> 00:02:35,550
I'm just going to set it its location to the switch group in tab one and I'm going to make this size

31
00:02:35,550 --> 00:02:41,190
also five and I'm going to go for this layout here.

32
00:02:41,340 --> 00:02:44,280
So on the left and the value on the right.

33
00:02:47,700 --> 00:02:52,890
Which is and I'm just going to change the label to some of the three most sense for this example.

34
00:02:53,160 --> 00:02:57,690
OK, click on Done and deploy and have a look now.

35
00:02:57,870 --> 00:03:03,900
And there's no switch group and switch is true, which is false.

36
00:03:04,900 --> 00:03:10,720
Now, again, I'd like to actually switch these two widgets over, so I want to switch to be on top

37
00:03:10,720 --> 00:03:12,410
and then the status in the bottom.

38
00:03:13,030 --> 00:03:13,960
So let's do that.

39
00:03:14,050 --> 00:03:17,960
To do that, I need to go into a couple of ways to do that.

40
00:03:18,370 --> 00:03:25,480
In this case, I'm going to go into the layout tab and I'm going to move actually this in the right

41
00:03:25,480 --> 00:03:25,990
order.

42
00:03:26,170 --> 00:03:28,320
And you can see still doesn't work.

43
00:03:28,330 --> 00:03:30,420
I want wanted to be the other way around.

44
00:03:30,850 --> 00:03:37,510
So then let's go into the layout for the tab and.

45
00:03:38,910 --> 00:03:42,390
Hmmm, maybe switch this over and see what effect that is going to have.

46
00:03:44,090 --> 00:03:47,660
Right, and had no effect.

47
00:03:48,560 --> 00:03:53,660
All right, so let's try something else so you can see what the problem is here, you need to experiment

48
00:03:53,660 --> 00:03:57,170
with this quite a few times and you'll get a tried.

49
00:03:57,620 --> 00:04:04,890
So flip these two widgets over in the layout tab and see if that has an effect.

50
00:04:04,910 --> 00:04:06,390
Yes, it did work this time.

51
00:04:07,010 --> 00:04:09,050
So false and true.

52
00:04:09,350 --> 00:04:09,860
All right.

53
00:04:11,970 --> 00:04:16,110
So she can see that using this switch is pretty straightforward and fairly easy.

54
00:04:16,560 --> 00:04:18,840
Now, let's move on to the next election.

55
00:04:18,840 --> 00:04:21,480
Now we'll show you how to use the dropdown widget.
