ソラマメブログ

2008年06月21日

テクスチャプレゼンター

これもよくある機能なんだけど
-----
Giving a PowerPoint Presentation in Second Life
-----
にあったのを少しだけ手直し(テクスチャの枚数を state_entry でしか設定していないのは問題があると思うんだよね... テクスチャ追加した時に)
-----
というわけで
-----
LSL Wiki : changed
-----
を見てインベントリーが変更された時 枚数設定し直すようにした
//
// File: TexturePresenter.lsl
// Date Author number of nodes
// 2008/6/20 walkinglint 13
//
integer invCount;
integer invLoopCount;
default {
state_entry() {
invCount = llGetInventoryNumber(INVENTORY_TEXTURE);
}
on_rez(integer param) {
llResetScript();
}
touch_start(integer total_number) {
llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, invLoopCount), ALL_SIDES);
invLoopCount++;
if (invLoopCount == invCount) {
invLoopCount = 0;
}
}
changed(integer change) {
if (change == CHANGED_INVENTORY) {
invCount = llGetInventoryNumber(INVENTORY_TEXTURE);
}
}
}
で 最初に参照した場所に
-----
With your prim sized, copy the uploaded textures from your inventory into the inventory of the prim in order of how you want them to appear. PowerPoint(R) will name the images Slide1, Slide2, etc., which means keeping them in order should be easy enough.
-----
の記述があって いまいち この llGetInventoryName で見つかる順番ってどういう順? インベントリーに登録した順番ってこと?
-----
と疑問に思い試してみると どうも アルファベット順のようである
-----
LlGetInventoryName - lslWiki
-----

-----
Note: The inventory is returned in alphabetical order.
-----
とあった これって仕様なんだよね... 仕様なのに Note ? w
-----
そうそう 前に インベントリーのものを渡すのと その前に お金を貰うのと をみたので これと組み合わせれば ベンダーが作れますね
-----
こんな感じになります
-----


同じカテゴリー(walking のスクリプティング講座)の記事
 プロフィール写真の表示に問題 (2009-11-30 20:55)
 ミニ太陽系 (2009-03-21 06:03)
 関数から文字列を返したら何か問題になる? (2009-03-18 18:02)
 llListFindList って型って関係ないんだったっけ (2009-03-18 14:02)
 夏時間(PDT)の実験 (2009-03-08 22:04)
 15パズルの作り方(その3) (2009-03-08 06:03)
上の画像に書かれている文字を入力して下さい
 
<ご注意>
書き込まれた内容は公開され、ブログの持ち主だけが削除できます。