OBY15
口の表情を変えるです。
オビーの口の形を変えられるようにするです。
■メソッドを追加します。
● ObyLipsクラスlipsShapメソッド
口の形を変えるメソッドを作ります。
口の形の各ポイントをいれた配列を引数で与えられるようにするです。
口のセンターをゲット
口の各ポイントを設定
口の位置を元のセンターへ
「スムージング」はとりあえずかけないのでコメントアウトしておくです。
--------------------------------------------
lipsShape: anArray
| center |
center _ self center.
self setVertices: (anArray).
self position: self position - self center + center.
self computeBounds.
"スムージング"
"self beSmoothCurve."
--------------------------------------------
アクセプト。
Alt + s ( Cmd + s )
● ObyクラスlipsShapeメソッド
Obyからも呼び出せるように同名のメソッドを追加するです。
--------------------------------------------
lipsShape: anArray
self lips lipsShape: anArray.
--------------------------------------------
アクセプト。
Alt + s ( Cmd + s )
● Obyクラスlipsメソッド
インスタンス変数lipsを返すメソッド
--------------------------------------------
lips
^ lips
--------------------------------------------
アクセプト。
Alt + s ( Cmd + s )
● ObyLipsクラスahaメソッド
口の形のポイントを設定します。
ここではとりあえずテストなんで、メソッド名とか口の形は適当に決めちゃった。
--------------------------------------------
aha
self lipsShape: {0@0. 20@5. 0@10. -20@5.}.
--------------------------------------------
アクセプト。
Alt + s ( Cmd + s )
● 同様にしていろんな口の形のメソッドを作るです。
スムーズ無し、有りの各キャプチャを参考の為、載せておくです。
--------------------------------------------
daha
self lipsShape: {0@0. 30@-5. 0@5. -30@-5.}.
--------------------------------------------
ehe
self lipsShape: {0@0. 15@-3. 0@2. -15@-3.}.
--------------------------------------------
gee
self lipsShape: {0@0. 10@5. 0@10. -10@5.}.
--------------------------------------------
goh
self lipsShape: {0@0. 5@0. 5@10. 0@10. -5@10. -5@0.}.
--------------------------------------------
heh
self lipsShape: {0@0. 5@7. 0@14. -5@7.}.
--------------------------------------------
hihi
self lipsShape: {0@0. 10@-5. 0@5. -10@-5.}.
--------------------------------------------
hohe
self lipsShape: {0@0. 15@5. 0@5. -15@5.}.
--------------------------------------------
hyo
self lipsShape: {0@0. 5@5. 0@10. -5@5.}.
--------------------------------------------
nee
self lipsShape: {0@0. 7@-5. 2@2. -15@2.}.
--------------------------------------------
nomal
self lipsShape: {0@0. 10@0. 0@6. -10@0.}.
--------------------------------------------
uhe
self lipsShape: {0@0. 10@10. 0@5. -10@10.}.
--------------------------------------------
uhyo
self lipsShape: {0@0. 15@10. 0@5. -15@10.}.
--------------------------------------------
■メソッドを修正します。
● ObyLipsクラスinitializeメソッド
口の形を変えられるようになったのでinitializeでもさっそく使うです。
--------------------------------------------
initialize
super initialize.
"vertices _ {0@0. 20@0. 10@6}."
self nomal.
color _ Color red darker.
borderColor _ Color black.
borderWidth _ 1.
closed _ true.
--------------------------------------------
アクセプト。
Alt + s ( Cmd + s )
★インスタンスで実際に試してみる
まずインスタンスのボビーをだすです。
--------------------------------------------
boby _ Oby new openInWorld
--------------------------------------------
Alt + d ( Cmd + d )
Obyクラスにahaメソッドはまだ作ってないのでこうなるのね。
--------------------------------------------
boby lips aha
--------------------------------------------
Alt + d ( Cmd + d )
● 以下も同様に試すです。
--------------------------------------------
boby lips daha
--------------------------------------------
boby lips ehe
--------------------------------------------
boby lips gee
--------------------------------------------
boby lips goh
--------------------------------------------
boby lips heh
--------------------------------------------
boby lips hihi
--------------------------------------------
boby lips hohe
--------------------------------------------
boby lips hyo
--------------------------------------------
boby lips nee
--------------------------------------------
boby lips nomal
--------------------------------------------
boby lips uhe
--------------------------------------------
boby lips uyo
--------------------------------------------
▲PREV ------ ● TOP ● ------ NEXT▼
■ MEMO ■
Links to this Page
- I BOBY last edited on 28 April 2004 at 8:57:55 pm by tk0005-202x210x196x109.ap-TK.usen.ad.jp
- OBY14 last edited on 18 June 2007 at 5:30:35 am by localhost.localdomain
- OBY16 last edited on 18 June 2007 at 5:15:37 am by localhost.localdomain