Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

HUD minimise/hide method?

Shifter Gynoid
South Aussie
Join date: 18 May 2007
Posts: 3
01-09-2008 03:59
I've just finished work on a little HUD for my own personal use that has a set of prims containing llLoadURL for quick and easy access to all my commonly used SL webpages. I am trying to work out the best method of minimising or hiding the HUD when not in use, without detatching it. currently, I have settled for a MessageLinked & link_message setup to change the HUD to Alpha all sides, which does achieve the desired results. This method is not not optimal though, as the alpha'd prims can still be clicked. I did try using all sorts of rotations to roll the HUD off screen, but found the rotations went haywire upon attaching. I am only learning LSL at the moment so can't handle any high-end scripting. Any positive advice will be greatly accepted.
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
01-09-2008 05:23
instead of rotating the hud, just move it to one side so that it is conveniently out of the way?
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
01-09-2008 05:43
The best way is to have the root prim placed at the particular rotation point you want, at one end of the HUD or what have you, so when the HUD rotates it rotates around that prim.

You can use llSetPrimitiveParams and set the rotation and position simultaneously, but there's a bug associated with that.
_____________________
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
01-09-2008 07:09
Send messages to the prims to put them in states where they don't have touch handlers. That way the user will even be able to click through them to objects in the world.

xcite uses a single texture for the whole HUD with invisible clickable prims; it only has to change one texture to go from maximized to minimized. (Along with changing the button prim states or otherwise making them unresponsive to touch.)

The invisible prim method has the disadvantage that if you're building and while trying to drag the texture onto an object accidentally drag it onto the clear part of the HUD, it doesn't do what you want. If the HUD is modifiable, it gets the texture. This may interfere a bit with your love life. (I speak from experience -- but happy to report that xcite was very helpful fixing it for me. I now detach before building. :) ) If the HUD isn't user modifiable, then the drop simply fails, which isn't bad.

For another example, see the ZHAO HUD, which is open source, has several buttons, and minimizes (I'm not sure how). Not the ZHAO II HUD, which only has two buttons so doesn't need a minimize feature. Sorry, I don't know where you can find the source, but I know it's around somewhere.
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
01-09-2008 07:15
From: Day Oh
The best way is to have the root prim placed at the particular rotation point you want, at one end of the HUD or what have you, so when the HUD rotates it rotates around that prim.

You can use llSetPrimitiveParams and set the rotation and position simultaneously, but there's a bug associated with that.


Day, in general I don't find that the center of rotation is the center of the root prim. Maybe this works in certain cases, though. It certainly doesn't happen for things like prim necklaces; the center of rotation is somewhere near the middle of the whole object, even there's no prim there.
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
01-09-2008 09:51
You can use llSetPos in a child prim to move it. The coordinate system is relative to the root prim. And you're right, child prim rotations get screwey when you attach the object, because they use the avatar's rotation as a reference, or the attachment as a whole, or something like that... been a while since I messed with this.

The original ZHAO sent a link message to a script in each child prim, telling it where to move itself. In the "hidden" setting, all the prims moved themselves behind the root prim, so you didn't see them.

But that was then. Today, there's llSetLinkPrimitiveParams (might have the name slightly wrong) which lets a script in the root prim adjust properties of the child prims, including their position. So you don't need a script in each child prim any more, you can move all the child prims from a script in the root prim.

You should be able to pick up an open-source copy of the old ZHAO from an animation store and look at the code in it. I don't have it in my store any more since I released ZHAO-II. If you can't find it, send me an IM, and I'll see if I have a copy in my inventory, which I can give you.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-09-2008 12:37
From: Lear Cale
Day, in general I don't find that the center of rotation is the center of the root prim. Maybe this works in certain cases, though. It certainly doesn't happen for things like prim necklaces; the center of rotation is somewhere near the middle of the whole object, even there's no prim there.


The center of rotation is different for scripted rotation and rotation using the build tools (actually just the mouse-driven build editing). Mouse rotation rotates (very annoyingly IMO) around the object's geometric center. The numeric rotation fields in the build window, and scripted rotation, happen about the center of the root prim.
Shifter Gynoid
South Aussie
Join date: 18 May 2007
Posts: 3
01-09-2008 14:22
Thanks for the helpful replies so far, this gives me a lot of new things to work with. As for the rotation method I tried, it all worked perfectly when rezzed on the ground. It just took on a mind of it's own when attached.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-09-2008 20:34
the excite hud refrence above uses a state change, removing all touch handles and makine the parts invisible via llSetAlpha (or the equivalent llSetLinkPrimitiveParams call). and leaves a single prim unmodified, which has it's own touch handler and simply serves to send a message to the root and change the state (reenabling it)

the idea of rotating it sounds nicer though, since you don't have an invisible object taking up space and preventing clicks on items seen through it... I'd imagine a setup something like a half cut root prim, with a quarter cut out(L shaped) 'minimize' button prim that stick up through the cut face and the the long hud face... clicking the button prim sends a mesage to the root which calls a rotation similar to a door script, rotationg it all out of view
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Arcane Clawtooth
5 By 5
Join date: 7 Jan 2008
Posts: 201
01-10-2008 06:37
From: Lear Cale

For another example, see the ZHAO HUD, which is open source, has several buttons, and minimizes (I'm not sure how). Not the ZHAO II HUD, which only has two buttons so doesn't need a minimize feature. Sorry, I don't know where you can find the source, but I know it's around somewhere.


ZHAO minimizes by moving all the buttons behind the root one, then moving them back. Only really works if all the buttons are the same size.

You can find a copy in world by searching for Ziggy Puff's profile, it's in his Picks tab.
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
01-10-2008 06:49
From: Hewee Zetkin
The center of rotation is different for scripted rotation and rotation using the build tools (actually just the mouse-driven build editing). Mouse rotation rotates (very annoyingly IMO) around the object's geometric center. The numeric rotation fields in the build window, and scripted rotation, happen about the center of the root prim.


Thanks for the correction, Hewee! This resolves some confusion on my part. :) Not the last, I'm sure.