LlGetRegionDayOffset/ja
< LlGetRegionDayOffset
Jump to navigation
Jump to search
Revision as of 13:24, 2 November 2023 by Misaki Vanilla (talk | contribs)
LSL ポータル | 関数 | イベント | 型 | 演算子 | 定数 | 実行制御 | スクリプトライブラリ | カテゴリ別スクリプトライブラリ | チュートリアル |
要約
関数: integer llGetRegionDayOffset( );
Return the number of seconds added to the current time before calculating the current environmental time for the region. llGetDayOffset returns the value for the current parcel, llGetRegionDayOffset produces the same value for the entire region.
integer で返します。
サンプル
// print the apparent time of day as HH:MM (%), just like the environment window in the viewer.
// Time of day is a fraction between 0 and 1, 0 is midnight, 0.5 is noon
string printTimeOfDay(float dayFraction) {
integer hours = (integer)(dayFraction * 24);
integer minutes = (integer)(dayFraction * 24 * 60) % 60;
integer percent = (integer)(dayFraction * 100);
return (string)hours + ":" + llGetSubString((string)(100+minutes), 1, 2) + " (" + (string)percent + "%)";
}
default {
state_entry() {
llSetTimerEvent(5);
}
timer() {
float timeOfDay = (llGetUnixTime() + llGetRegionDayOffset()) % llGetRegionDayLength() * 1.0 / llGetRegionDayLength();
llSetText(printTimeOfDay(timeOfDay), <1,1,0>, 1);
}
}
関連項目
関数
• | llGetEnvironment/ja | Newer function that consolidates many environment-based settings. | ||
• | llGetDayLength/ja | |||
• | llGetDayOffset/ja | |||
• | llGetMoonDirection/ja | |||
• | llGetMoonRotation/ja | |||
• | llGetSunDirection/ja | |||
• | llGetSunRotation/ja | |||
• | llGetRegionDayLength/ja | |||
• | llGetRegionDayOffset/ja | |||
• | llGetRegionMoonDirection/ja | |||
• | llGetRegionMoonRotation/ja | |||
• | llGetRegionSunDirection/ja | |||
• | llGetRegionSunRotation/ja |
特記事項
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。