Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Hud Adjustment
- vector stayOnScreen;
- vector hudAdjust(float aspect, integer newPos) {
- vector rootPrim = llList2Vector(llGetLinkPrimitiveParams(LINK_ROOT, [PRIM_POS_LOCAL]), 0);
- return llList2Vector(["Keeps HUD on screen no matter users screen width.",
- /*Top Left - Justified = 1*/ <0.0, ( (aspect / 2) - (rootPrim.y / 2) - 0.03), (0.5 - (rootPrim.z / 2) - 0.07)>,
- /*Top Center - Justified = 2*/ <0.0, 0.0, (0.5 - (rootPrim.z / 2) - 0.07)>,
- /*Top Right - Justified = 3*/ <0.0, (-(aspect / 2) + (rootPrim.y / 2) + 0.03), (0.5 - (rootPrim.z / 2) - 0.07)>,
- /*Center Left - Justified = 4*/ <0.0, ( (aspect / 2) - (rootPrim.y / 2) - 0.03), 0.0>,
- /*Center Center - Justified = 5*/ <0.0, 0.0, 0.0>,
- /*Center Right - Justified = 6*/ <0.0, (-(aspect / 2) + (rootPrim.y / 2) + 0.03), 0.0>,
- /*Bottem Left - Justified = 7*/ <0.0, ( (aspect / 2) - (rootPrim.y / 2) - 0.03), (-0.5 + (rootPrim.z / 2) + 0.03)>,
- /*Bottem Center - Justified = 8*/ <0.0, 0.0, (-0.5 + (rootPrim.z / 2) + 0.03)>,
- /*Bottem Right - Justified = 9*/ <0.0, (-(aspect / 2) + (rootPrim.y / 2) + 0.03), (-0.5 + (rootPrim.z / 2) + 0.03)>
- ], newPos);
- }
- default {
- run_time_permissions(integer perms) {
- integer attached = llGetAttached();
- if (attached = ATTACH_HUD_CENTER_1 || ATTACH_HUD_CENTER_2) {
- if (!attached) llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA);
- else if (perms & PERMISSION_TRACK_CAMERA) { stayOnScreen = hudAdjust(llGetCameraAspect(), 5); }
- } else { llOwnerSay("Please attach to center2 hud position."); llDetachFromAvatar(); }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement