llGetDayLength/ja

From Second Life Wiki
< LlGetDayLength
Revision as of 19:01, 7 October 2023 by Misaki Vanilla (talk | contribs) (copy from english(Todo: need translate to japanese))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Summary

Function: integer llGetDayLength( );

Return the number of seconds in the day cycle applied to the current parcel. llGetDayLength returns the number of seconds for the current parcel, llGetRegionDayLength is the number of seconds in the day cycle applied to the entire region.
Returns an integer

Examples

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

See Also

Functions

•  llGetEnvironment Newer function that consolidates many environment-based settings.
•  llGetDayLength
•  llGetDayOffset
•  llGetMoonDirection
•  llGetMoonRotation
•  llGetSunDirection
•  llGetSunRotation
•  llGetRegionDayLength
•  llGetRegionDayOffset
•  llGetRegionMoonDirection
•  llGetRegionMoonRotation
•  llGetRegionSunDirection
•  llGetRegionSunRotation

Deep Notes

Signature

function integer llGetDayLength();