Touch end/ja

From Second Life Wiki
< Touch end
Revision as of 10:28, 21 February 2016 by SakuraNoel Fayray (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

説明

! イベント: touch_end( integer num_detected ){ ; }

エージェントがタスクのクリックをやめたときに発生します。

• integer num_detected

警告

  • タッチ系 イベント がない 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:

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");
    }
}
// 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;
    }
}

参考情報

イベント

•  touch_start
•  touch

関数

•  llPassTouches

特記事項

議論

   Server drops first touch event when a script returns to a state with a touch_start handler
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。