Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

restricted movement

Monkey Edge
Registered User
Join date: 23 Apr 2005
Posts: 69
05-20-2006 16:21
ok im doing a job app for Gnat Technologys you may have heard of them yo umay not of

as per the rules i dont want a script that will do what i want, examples are fine, but nothin that will solve my problem

how can i make a object move within the confines of a box?(AKA a computer screen)
_____________________
What do today what you can put off till tommorrow
But.......
What is today but yesterday's tommorrow
Jonas Pierterson
Dark Harlequin
Join date: 27 Dec 2005
Posts: 3,660
05-20-2006 16:36
Use an animated texture.


Please learn to type.
_____________________
Good freebies here and here

I must protest. I am not a merry man! - Warf, ST: TNG, episode: Qpid

You killed my father. Prepare to die. - Inigo Montoya, The Princess Bride

You killed My father. Your a-- is mine! - Hellboy
Monkey Edge
Registered User
Join date: 23 Apr 2005
Posts: 69
05-20-2006 16:52
i type to fast for my own good

and an animated texture? how would i be able to move it around with the arrow keys then?

also the computer needs to be moveable so i need to know how to do this
_____________________
What do today what you can put off till tommorrow
But.......
What is today but yesterday's tommorrow
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
05-21-2006 05:47
Use the function that gets the world coordinates of the computer screen and probably the SIZE of the screen as well. Use these to figure out where your box is (i.e. (size / 2) +/- position) and before moving the box check to see if the position it'd be moving to is inside the box, if so, move it.
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
05-21-2006 06:11
You could also use an outsize texture.

Make the texture's size equal to (screen's width + box width) * (screen's height + box height). When uploaded SL will helpfully undo this and apply a ratio that fits the whole texture onto the screen, so use the texture controls to undo this and create a 1:1 texel ratio. Then you can move the box around by changing the texture offset.
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
05-21-2006 06:34
To move it around in-world with arrow keys, you'll need to take the controls of the user and test for them, using llRequestPermissions, llTakeControls and the control() event. Lots of examples in the wiki for that, plus lots of scripts use it.