“LlGetDayOffset”的版本间的差异
| 第36行: | 第36行: | ||
| |相关函数=	 | |相关函数=	 | ||
| [[llGetDayLength]] | [[llGetDayLength]] | ||
| + | |||
| [[llGetDayOffset]] | [[llGetDayOffset]] | ||
| + | |||
| [[llGetMoonDirection]] | [[llGetMoonDirection]] | ||
| + | |||
| [[llGetMoonRotation]] | [[llGetMoonRotation]] | ||
| + | |||
| [[llGetSunDirection]] | [[llGetSunDirection]] | ||
| + | |||
| [[llGetSunRotation]] | [[llGetSunRotation]] | ||
| + | |||
| [[llGetRegionDayLength]] | [[llGetRegionDayLength]] | ||
| + | |||
| [[llGetRegionDayOffset]] | [[llGetRegionDayOffset]] | ||
| + | |||
| [[llGetRegionMoonDirection]] | [[llGetRegionMoonDirection]] | ||
| + | |||
| [[llGetRegionMoonRotation]] | [[llGetRegionMoonRotation]] | ||
| + | |||
| [[llGetRegionSunDirection]] | [[llGetRegionSunDirection]] | ||
| + | |||
| [[llGetRegionSunRotation]] | [[llGetRegionSunRotation]] | ||
2021年9月1日 (三) 10:04的最新版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials | 
| 函数名 | 
|---|
| Function: integer llGetDayOffset( ) | 
| 参数:无 | 
| 返回值:返回在计算包裹的当前环境时间之前添加到当前时间的秒数。llGetDayOffset返回当前包裹的值,llGetRegionDayOffset为整个区域产生相同的值。 | 
| 注意事项 | 
|---|
| 注意事项 | 
| 示例 | 
|---|
| // 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() + llGetDayOffset()) % llGetDayLength() * 1.0 / llGetDayLength();
        llSetText(printTimeOfDay(timeOfDay), <1,1,0>, 1);
    }
}
 | 
| 相关函数 | 
|---|
| llGetDayLength | 
| 相关事件 | 
|---|
