Here's a general tip on understanding the way the dash works.
Default.xip / Default.xap is used to mainly call up other things and controll the main menu.
In the Default.xip you'll see a bunch of other xaps with the names of the menus they controll. Those xaps controll the functionality of those menus, and if an object moves where it moves to.
Take the clock menu for instance. The xap that controls it is the settings.xap inside default.xip. If you scroll down a bit in the settings.xap you'll come across
CODE
DEF theSetClockMenu Level
{
name "theSetClockMenu"
archive "Settings_Clock.xip"
the name theSetClockMenu is used to refer to the archive for various things; What text to update, what object to texture when, and where to move objects. Now the original placement of objects and the default text is defined in the archive. Which in this case is Settings_Clock.xip.
Inside the DEF theSetClockMenu Level you'll see an inline
CODE
Inline
{
url "Settings_Clock/default.xap"
function onLoad() { StartClockSettings(); }
}
Most inlines are found in default/default. In this case, it's found inside the settings.xap. The url in the inline is telling the dash what file to use to find out all of the menus properties for placement and materials. As you can see it's telling it to use the default.xap inside the Settings_Clock.xip. It's important to have an inline tell the dash what xap to use because some xips contain more then just one xap, and if a xap is used to load up one menu it can't be used to load a second menu... (IE the memory manager and the hard drive menu) In this case a second default.xap would be needed and would be named anything ( usually default2.xap ) and the inline would call for the second xap.
Now if you wanted to edit the clock menu you'd know what xap was controlling all of the materials and placement. Also, the xap would also be using the xm files (meshes) from inside the xip the xap is loaded from. So to find what object you wanted to retexture, you could look inside the xip and see the list of meshes used for the menu. Some meshes, like the cellwall, aren't included in the xip to save space.
Check out each xm untill you find the mesh you want and search for it's name inside the inline's target. (Settings_Clock/default.xap) It should bring you to a DEF of the object. Some meshes are used more then once so search around to get a better sence of where the object you want is defined. Once you're at the right DEF it should look similar to
CODE
DEF something Transform
{
children
[
Shape
{
appearance Appearance
{
material MaxMaterial
{
name "somematerial"
}
}
geometry DEF something-object Mesh { url "something-object.xm" }
}
]
rotation
scale
scaleOrientation
translation
}
Now, You can edit the original properties of the object in question in the inline target (Settings_Clock/default.xap)or you can redefine it using the controll xap. (default/settings.xap)
If you wanted to use the controlling xap you'd refer to the object by
CODE
thename.children[0].children[0].theobject.children[0].the.attribute = "the update";
Which is
CODE
theSetClockMenu.children[0].children[0].something.children[0].appearance.material.name = "Typesdsafsda";
Or if you were to redefine a number of objects you can simplify the process by making the name into a variable.
CODE
var c = theSetClockMenu.children[0].children[0];
c.something.children[0].appearance.material.name = "Typesdsafsda";
c.something1.children[0].appearance.material.name = "HilightedType";
the c before the object is defined above the function so it knows what c represents. As you can see if you replace the c with what it is defined as it would be the same as the set up above. This set up is usefull because it lets you easily see what objects you're redefining. If you wanted to update more then one attribute of an object this set up is usefull too. You would set it up like
CODE
var c = theSetClockMenu.children[0].children[0];
c.something.fade = 0; // speed of transition of something, higher numbers = slower
c.something.SetTranslation( -8.773, 4.723, 71.96 ); //makes something move
c.something.SetScale( 1, 1, 1);//defines the size of something
as you can see the .children[0] is missing from c.something.children[0]. If you look above you can see that in the DEF the apperance, material, material name, and mesh are defined inside children [ ] and the rotation, translation, scaleOrientation and scale aren't. That's the reason .children[0] isn't needed in this case
Using the controll xap to update the object is usefull for having the object update on button presses. If you want the object to first appear a certain way or position it's better to define it in the inline xap.
I hope this helps out with what ever mods you guys do to the UIX dash. If you got a question on something, go ahead and ask.
A list of scriptable functions is located in the UIX readme.
QUOTE(Odb718 @ Oct 22 2005, 09:59 PM)
c.something.SetTranslation( -8.773, 4.723, 71.96 ); //makes something move
I dont get your question. SetTranslation means where the object is. If you change the values ( x, y, z ) the object/group will move to that spot on the screen. If you want it to return to it's original spot in another function you'd need to copy the values out of the xap.
QUOTE(Odb718 @ Oct 22 2005, 09:59 PM)
c.something.SetScale( 1, 1, 1);//defines the size of something
rotation can have 4 variables in it. The readme should have examples of all the scriptables.
QUOTE(JbOnE @ Dec 20 2005, 11:44 PM)
rotations are set using quaternions. the first 3 are the x, y, z values of the axis vector, the last is the angle in radians of the rotation on that axis. google up the theory behind 3d vectors to clear up any questions on that part
I was right! HAHA! Your's sounds more technical though.
uuuuuhhhh... I think you misread JbOnE's post.
QUOTE
the last is the angle in radians of the rotation on that axis.
QUOTE(midas @ Dec 19 2005, 05:27 AM)
Rotation Point?
I thought it was X,Y,Z, Radians?
I think thats what acid said (it might have been him)
QUOTE(JbOnE @ Dec 20 2005, 11:44 PM)
rotations are set using quaternions. the first 3 are the x, y, z values of the axis vector, the last is the angle in radians of the rotation on that axis. google up the theory behind 3d vectors to clear up any questions on that part
ok ok lemme say it a little slower for you....
the last is the angle
in radians
of the rotation
on that axis
it can also be said like
the last is the angle
of the rotation
radians are a unit of measurement.
I think all the prepositional phrases threw you off a little. but like gas said... QUOTE
well from what ive always thought, ^^ its sorta the same.
What I ment by rotation point was more along the lines of where it's at on the arch.
anywho it's all cleared up now