Skip to content
JC edited this page Mar 11, 2023 · 3 revisions

Panels are the foundation of a UI in instrumental. They are flat or curved surfaces that contain a data schema that describes an entire layout within: the dimensions of the panel, the visual representation of the panel including the panel type (square, filleted, or rimmed and filleted), colors, tessellation, and a list of all controls within. From the data in the schema, the panel assembles the entire UI it contains - including its own manifestation and all controls that it owns.

        public PanelType PanelType;
        public SpaceType SpaceType;
        public float SpaceCurveRadius;
        public Vector2 PanelDimensions;
        public float Depth;
        public float Radius;
        public int RadiusSegments;
        public float BorderThickness;

        public Color BorderColor;

        public ControlSchema[] Controls;

PanelType an enum describing whether the panel is square or filleted SpaceType an enum describing whether the panel is rectilinear, cylindrical, or spherical. Note that for now, cylindrical and spherical are non functional, pending a replacement to the spacewarp system that is no longer part of the project. SpaceCurveRadius describes the radius of the curved space the panel resides within PanelDimensions a 2 dimensional vector describing the height and width of the panel Depth the physical depth of the panel. Radius for filleted panels, this is the rounding radius of the corners Radius Segments for filleted panels, this is how many slices the border will have for its bevel BorderThickness the inset thickness of the border rim on the panel, as a percentage of the radius.

Construction

Panels have the following unity scene elements: Root Game Object (Panel) this contains the highest level controls - a panel script, a trigger collider for detecting new controls to place on the panel (only used at design time). FilletPanel a graphic for drawing the panel when it is a fillet panel. BoxPanel a graphic for drawing the panel when it is a box panel. FlatPanel a graphic for drawing the panel when it is just a quad SquareOutline a graphic for when the panel has a square outline SurfaceCollider a collider for representing the physical surface of the collider. When placing elements on the panel, they will snap to this. It also has 'color zones' for detecting color-picker-drop events. ColorZones are design-time elements Rails/Handles these are design-time elements for changing the dimensions of the panel BorderColorZone a color zone for the border of the panel. Supports directional detection for gradient color editing

The panel class handles receiving all design-time changes from the editing handles and re-propagating them to the stored schema so that the schema can be saved for later re-use. It also handles properly enabling/disabling the child fillet/box/flat model generators so that the panel's appearance matches its type.

Unfinished Elements

Panels do not yet currently have a method for instantiating child controls. Currently the only way to add a control to a panel is at design-time, by grabbing one from the palette and placing it on the panel. Since save/load is not yet implemented, and starting instantiation is not yet implemented, this means the panel designer is essentially non-functional aside from demo uses. Will be implementing control instantiation soon, once control prefabs are available.

Clone this wiki locally