Difference between revisions of "LlSetColor/ja"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 5: Line 5:
|p1_type=vector|p1_name=color|p2_type=integer|p2_name=face
|p1_type=vector|p1_name=color|p2_type=integer|p2_name=face
|func_footnote
|func_footnote
|func_desc='''face'''上の'''color'''を設定します。
|func_desc='''face''' '''color''' を設定します。
|return_text
|return_text
|spec
|spec
Line 18: Line 18:
     touch_start(integer num)
     touch_start(integer num)
     {
     {
         if(~face)//quick & dirty check for -1
         if(~face)//おおざっぱな -1 チェック
             llSetColor(color, face); //restore the color
             llSetColor(color, face); //色を復元します
         face = (face + 1) % llGetNumberOfSides(); //increment and keep the face number in range
         face = (face + 1) % llGetNumberOfSides(); //面番号をインクリメントして保持します
         color = llGetColor(face); //save the face's color
         color = llGetColor(face); //面の色を保存します
         llSetColor(<0.5, 0.0, 0.0>, face );//change the face's color
         llSetColor(<0.5, 0.0, 0.0>, face );//面の色を変更します
     }
     }
}
}
Line 28: Line 28:
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||[[llGetAlpha/ja|llGetAlpha]]|プリムのアルファを取得します}}
{{LSL DefineRow||{{LSLG/ja|llGetAlpha}}|プリムの透過度を取得します}}
{{LSL DefineRow||[[llSetAlpha/ja|llSetAlpha]]|プリムのアルファを設定します}}
{{LSL DefineRow||{{LSLG/ja|llSetAlpha}}|プリムの透過度を設定します}}
{{LSL DefineRow||[[llGetColor/ja|llGetColor]]|プリムの色を取得します}}
{{LSL DefineRow||{{LSLG/ja|llGetColor}}|プリムの色を取得します}}
{{LSL DefineRow||[[llSetLinkColor/ja|llSetLinkColor]]|リンクプリムの色を設定します}}
{{LSL DefineRow||{{LSLG/ja|llSetLinkColor}}|リンクプリムの色を設定します}}
{{LSL DefineRow||[[llSetLinkAlpha/ja|llSetLinkAlpha]]|リンクプリムのアルファを設定します}}
{{LSL DefineRow||{{LSLG/ja|llSetLinkAlpha}}|リンクプリムの透過度を設定します}}
|also_tests
|also_tests
|also_events=
|also_events=
{{LSL DefineRow||[[changed/ja|changed]]|[[CHANGED_COLOR/ja|CHANGED_COLOR]]}}
{{LSL DefineRow||{{LSLG/ja|changed}}|{{LSLG/ja|CHANGED_COLOR}}}}
|also_articles
|also_articles
|notes
|notes

Revision as of 00:44, 9 May 2010

要約

関数: llSetColor( vector color, integer face );

facecolor を設定します。

• vector color RGB の <R, G, B> (<0.0, 0.0, 0.0> = 黒, <1.0, 1.0, 1.0> = 白)
• integer face 番号もしくは ALL_SIDES

faceALL_SIDES であれば関数は全ての面に作用します。

初心者にありがちな注意点

llSetColor はプリムの指定面、あるいはプリムの全ての色を変更します。

例:
llSetColor(<r, g, b>, ALL_SIDES);

r, g, b: 赤・緑・青、の値で、それぞれが 0.0 から 1.0 の範囲をとります。

警告

  • face が存在しない面を指している場合、関数はエラーを出さずに復帰します。
All Issues ~ Search JIRA for related Bugs

サンプル

<lsl> integer face = -1; vector color = <1.0, 1.0, 1.0>;

default {

   touch_start(integer num)
   {
       if(~face)//おおざっぱな -1 チェック
           llSetColor(color, face); //色を復元します
       face = (face + 1) % llGetNumberOfSides(); //面番号をインクリメントして保持します
       color = llGetColor(face); //面の色を保存します
       llSetColor(<0.5, 0.0, 0.0>, face );//面の色を変更します
   }

}

</lsl>

関連項目

イベント

•  changed CHANGED_COLOR

関数

•  llGetAlpha プリムの透過度を取得します
•  llSetAlpha プリムの透過度を設定します
•  llGetColor プリムの色を取得します
•  llSetLinkColor リンクプリムの色を設定します
•  llSetLinkAlpha リンクプリムの透過度を設定します

記事

•  LSL での色

特記事項

Search JIRA for related Issues

Signature

function void llSetColor( vector color, integer face );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。