Difference between revisions of "Touch end/ja"
Asuka Neely (talk | contribs) m |
Mako Nozaki (talk | contribs) m |
||
Line 1: | Line 1: | ||
{{LSL_Event/ja|event_id=4|event_delay|event=touch_end | {{Template:Issues/SVC-3017/ja}}{{LSL_Event/ja|event_id=4|event_delay|event=touch_end | ||
|p1_type=integer|p1_name=num_detected|p1_desc | |p1_type=integer|p1_name=num_detected|p1_desc | ||
|event_desc= | |event_desc=エージェントがタスクのクリックをやめたときに発生します。 | ||
|constants | |constants | ||
|spec | |spec | ||
|caveats | |caveats=* プリムの {{LSLG/ja|face|面}} で [[Navigating Shared Media|Shared Media]] が動作していて、アバターのビューワがその機能をサポートしている場合、 LSL スクリプトはこの面に対するタッチを検出しません。以前のビューワでのタッチされたものは検出します。 | ||
|examples= | |examples=You can use numbers 0 through num_detected - 1 to get detected agent keys: | ||
<lsl>float t; | <lsl>float t; | ||
Line 17: | Line 17: | ||
{ | { | ||
llOwnerSay((string)(llGetTime() - t) + " seconds between touch_start and touch_end"); | llOwnerSay((string)(llGetTime() - t) + " seconds between touch_start and touch_end"); | ||
} | |||
}</lsl><lsl>// If using a touch to change states be careful about the touch_ event order... | |||
// On clicking a prim with touch events we trigger touch_start (as), touch (during) and touch_end (as released). | |||
// The chain of events is established in the script as touch_start is triggered that remains intact until either | |||
// touch_end is triggered or a new touch_start (discounting resets, deletions, taking to inventory etc.). | |||
default | |||
{ | |||
touch_start(integer nd) | |||
{ | |||
llSay(0, "You just started touching me so I'm going to the other state..."); | |||
state other; | |||
} | |||
// A very rapid click would (and does if your VERY quick) beat the state change so the script would/does not behave as expected. | |||
} | |||
state other | |||
{ | |||
touch_end(integer nd) | |||
{ | |||
// The average click will have you catapult through this state with nothing but a chatted message to remember it by. | |||
llSay(0, "The touch that brought you here just ended so I'm going back to default..."); | |||
state default; | |||
} | } | ||
}</lsl> | }</lsl> | ||
Line 22: | Line 47: | ||
|also_header | |also_header | ||
|also_events= | |also_events= | ||
{{LSL DefineRow||[[ | {{LSL DefineRow||[[touch_start]]|}} | ||
{{LSL DefineRow||[[ | {{LSL DefineRow||[[touch]]|}} | ||
|also_functions= | |also_functions= | ||
{{LSL DefineRow||[[ | {{LSL DefineRow||[[llPassTouches]]|}} | ||
|also_articles | |also_articles | ||
|also_footer | |also_footer |
Revision as of 13:28, 20 May 2010
LSL ポータル | 関数 | イベント | 型 | 演算子 | 定数 | 実行制御 | スクリプトライブラリ | カテゴリ別スクリプトライブラリ | チュートリアル |
警告
- タッチ系 イベント がない state からタッチ系イベントがある state に遷移すると、最初のタッチ系イベントは失われます。これは 3 つのタッチ系イベント全て (touch_start, touch, touch_end) にあてはまります。 SVC-3017 を参照してください。
- プリムの 面 で Shared Media が動作していて、アバターのビューワがその機能をサポートしている場合、 LSL スクリプトはこの面に対するタッチを検出しません。以前のビューワでのタッチされたものは検出します。
サンプル
You can use numbers 0 through num_detected - 1 to get detected agent keys: <lsl>float t;
default {
touch_start(integer num_detected) { t = llGetTime(); } touch_end(integer num_detected) { llOwnerSay((string)(llGetTime() - t) + " seconds between touch_start and touch_end"); }
}</lsl><lsl>// If using a touch to change states be careful about the touch_ event order...
// On clicking a prim with touch events we trigger touch_start (as), touch (during) and touch_end (as released).
// The chain of events is established in the script as touch_start is triggered that remains intact until either
// touch_end is triggered or a new touch_start (discounting resets, deletions, taking to inventory etc.).
default {
touch_start(integer nd) { llSay(0, "You just started touching me so I'm going to the other state..."); state other; }
// A very rapid click would (and does if your VERY quick) beat the state change so the script would/does not behave as expected. } state other {
touch_end(integer nd) {
// The average click will have you catapult through this state with nothing but a chatted message to remember it by.
llSay(0, "The touch that brought you here just ended so I'm going back to default..."); state default; }
}</lsl>
参考情報
特記事項
議論
SVC-3017 | A | Server drops first touch event when a script returns to a state with a touch_start handler |