Object browser: Difference between revisions
>JulienDethurens Moved from Object Browser. |
>JulienDethurens Moved from Object Browser. |
(No difference)
|
Latest revision as of 03:24, 6 April 2012
The object browser shows all of the Instances. It shows what their properties, methods and events are and whether they are preliminary or deprecated.
Usage
You can access the Object Browser by going to Help > Object Browser, in Roblox Studio.
Doing this should cause a new tab to come up in studio, the object browser. In the left panel, you should see a list of objects. These are all of the classes, and enums that are available in Roblox. The top things are classes, like Part, or Script, and the ones at the end of the list, with a different symbol are enums, like FormFactor or Shape.
For example, take the class "Part". Scroll down in the right panel and find it, then click on it. In the center panel you should now have a list of various things. The things with a purple box next to them are methods, you should find the methods you would expect here for a part, such as "MakeJoints", as well as the methods like "FindFirstChild" and "Clone".
After the methods, you'll find the "Properties", they have blue box symbols next to them. These are things that you can set. For a Part, you'd find what you would expect, just like for methods. "Position", "Size", "BrickColor", and some global properties like "Name" and "Parent".
Scroll down and find "Shape" in the properties, click on it. In the bottom frame "PartType Shape Member of Part" Should come up. "PartType" is what kind of value Shape is, it's not a basic type, so you can infer that it's an Enum. What kinds of values can this have? You can use the object browser for this too.
The enum's type is "PartType", so scroll down to the bottom of the list in the left panel, and find "PartType". Click it, this should come up in the main frame:
- Ball
- Block
- Cylinder
Let's say you want to set the Shape of an object to be a ball, so now click on "Ball". This should come up in the bottom panel: 0: Ball This tells you that assigning a part's shape to be equal to 0 in a script will make it have the shape PartType::Ball.
Last but not least, you can look up events in the object browser too. Go back an select "Part" again in the left panel. Now scroll down in the main panel to the things with the lightning bolt symbols next to them, these are the events which you can use with the object. As you would expect, you can find the "Touched" event since we're looking at Part. Clicking on the event will show you in the bottom panel, what arguments a function connected to the event will have passed to it. (See also Event)
This can be very useful when you don't know the name of a property, need to look up what the value you want for an enum is, or what the arguments of an event are, you can simply look them up in the object browser.
Items in italics are preliminary, under development, and are likely to change. Use them only for experimental work.
In Studio, under Tools -> Settings... > Authoring you can enable the display of preliminary and/or deprecated entries.
Advanced
By editing the ReflectionMetadata.xml file that comes with Roblox, you can make some hidden classes visible in Roblox Studio and in the object browser.