Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions examples/src/examples/graphics/lights-baked.controls.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, BooleanInput, LabelGroup, Panel } = ReactPCUI;
return fragment(
jsx(
Panel,
{ headerText: 'Lights' },
jsx(
LabelGroup,
{ text: '🟢 Omni' },
jsx(BooleanInput, {
type: 'toggle',
binding: new BindingTwoWay(),
link: { observer, path: 'data.lights.omni' },
value: observer.get('data.lights.omni')
})
),
jsx(
LabelGroup,
{ text: '🔴 Spot' },
jsx(BooleanInput, {
type: 'toggle',
binding: new BindingTwoWay(),
link: { observer, path: 'data.lights.spot' },
value: observer.get('data.lights.spot')
})
),
jsx(
LabelGroup,
{ text: '🟡 Directional' },
jsx(BooleanInput, {
type: 'toggle',
binding: new BindingTwoWay(),
link: { observer, path: 'data.lights.directional' },
value: observer.get('data.lights.directional')
})
),
jsx(
LabelGroup,
{ text: ' 🟡 Soft' },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What're the additional spaces at the start of the label for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was supposed to be indented .. as it applies to directional light only, but it didn't work :)

jsx(BooleanInput, {
type: 'toggle',
binding: new BindingTwoWay(),
link: { observer, path: 'data.lights.soft' },
value: observer.get('data.lights.soft')
})
)
)
);
};
Loading