-
Notifications
You must be signed in to change notification settings - Fork 1
/
facecontrol.mxml
105 lines (90 loc) · 3.61 KB
/
facecontrol.mxml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:local="*"
layout="absolute"
frameRate="30"
>
<mx:Script>
<![CDATA[
import flash.system.Capabilities;
private function redraw():void {
if (blob.m + blob.p + blob.q >= 0) {
validMouth.text = "mouth ok";
} else {
validMouth.text = "bad mouth: m + p + q < 0";
}
blob.redraw();
}
]]>
</mx:Script>
<mx:HBox width="100%" height="100%">
<mx:VBox height="100%">
<mx:Label text="Mouth Parameters:"/>
<mx:HBox>
<mx:Label text="m:"/>
<mx:HSlider id="m" width="100" minimum="0" maximum="4" value="{blob.m}" liveDragging="true" change="blob.m = m.value; redraw()"/>
<mx:TextInput width="30" editable="false" text="{blob.m}"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="p:"/>
<mx:HSlider id="p" width="100" minimum="-1" maximum="1" value="{blob.p}" liveDragging="true" change="blob.p = p.value; redraw()"/>
<mx:TextInput width="30" editable="false" text="{blob.p}"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="q:"/>
<mx:HSlider id="q" width="100" minimum="-1" maximum="1" value="{blob.q}" liveDragging="true" change="blob.q = q.value; redraw()"/>
<mx:TextInput width="30" editable="false" text="{blob.q}"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="r:"/>
<mx:HSlider id="r" width="100" minimum="0" maximum="1" value="{blob.r}" liveDragging="true" change="blob.r = r.value; redraw()"/>
<mx:TextInput width="30" editable="false" text="{blob.r}"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="s:"/>
<mx:HSlider id="s" width="100" minimum="0" maximum="1" value="{blob.s}" liveDragging="true" change="blob.s = s.value; redraw()"/>
<mx:TextInput width="30" editable="false" text="{blob.s}"/>
</mx:HBox>
<mx:HRule width="100%"/>
<mx:Label id="validMouth"/>
<mx:HRule width="100%"/>
<mx:Label text="Mouth Presets:"/>
<mx:HBox>
<mx:Button label="Smile"
click="blob.set(1, -0.5, 0.0, 0, 0.4); blob.redraw()"/>
<mx:Button label="Glee"
click="blob.set(0, 0.7, 0.9, 0, 0); blob.redraw()"/>
<mx:Button label="Joy"
click="blob.set(2, 0.2, 0, 0, 0.15); blob.redraw()"/>
</mx:HBox>
<mx:HBox>
<mx:Button label="Sad 1"
click="blob.set(1, 0, -0.5, 0, 0.7); blob.redraw()"/>
<mx:Button label="Sad 2"
click="blob.set(1, 0, 0, 0, 0.75); blob.redraw()"/>
<mx:Button label="Grief"
click="blob.set(2.5, -0.5, -0.7, 0.5, 0.5); blob.redraw()"/>
</mx:HBox>
<mx:HBox>
<mx:Button label="Surprise"
click="blob.set(3, 0, 0, 0.3, 0.5); blob.redraw()"/>
<mx:Button label="Shock"
click="blob.set(2, 0, 0.5, 0, 0.9); blob.redraw()"/>
</mx:HBox>
<mx:HBox>
<mx:Button label="Worry"
click="blob.set(1, 1, 0.5, 0, 0.8); blob.redraw()"/>
<mx:Button label="Fear"
click="blob.set(0.5, 0.5, 0.5, 0.8, 0.5); blob.redraw()"/>
</mx:HBox>
<mx:HBox>
<mx:Button label="Anger 1"
click="blob.set(0, 1, 1, 0.7, 1); blob.redraw()"/>
<mx:Button label="Anger 2"
click="blob.set(0, 1, 1, 0.9, 0.5); blob.redraw()"/>
</mx:HBox>
</mx:VBox>
<local:face id="blob" width="100%" height="100%" />
</mx:HBox>
</mx:Application>