Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example controls updates #7093

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions examples/src/examples/animation/blend-trees-1d.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx }) {
export const controls = ({ observer, ReactPCUI, React, jsx }) => {
const { BindingTwoWay, LabelGroup, SliderInput } = ReactPCUI;
class JsxControls extends React.Component {
render() {
Expand All @@ -15,4 +15,4 @@ export function controls({ observer, ReactPCUI, React, jsx }) {
}
}
return jsx(JsxControls);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ React, jsx, fragment }) {
export const controls = ({ React, jsx, fragment }) => {
const { createRef, Component } = React;
class JsxControls extends Component {
position = new pc.Vec2();
Expand Down Expand Up @@ -140,4 +140,4 @@ export function controls({ React, jsx, fragment }) {
}
}
return jsx(JsxControls);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ React, jsx, fragment }) {
export const controls = ({ React, jsx, fragment }) => {
const { useEffect, useRef } = React;
/** @type {React.MutableRefObject<HTMLCanvasElement>} */
const canvasRef = useRef(null);
Expand Down Expand Up @@ -80,4 +80,4 @@ export function controls({ React, jsx, fragment }) {
canvas.addEventListener('mousedown', mouseEvent);
});
return fragment(jsx('canvas', { ref: canvasRef }));
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { Button } = ReactPCUI;
return fragment(
jsx(Button, {
Expand All @@ -12,4 +12,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
}
})
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/animation/layer-masks.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, LabelGroup, Panel, BooleanInput, SelectInput, SliderInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -98,4 +98,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/animation/locomotion.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, LabelGroup, BooleanInput, Button } = ReactPCUI;
const binding = new BindingTwoWay();
const link = {
Expand All @@ -26,4 +26,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
})
)
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/camera/multi.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, LabelGroup, Panel, BooleanInput, SliderInput } = ReactPCUI;

return fragment(
Expand Down Expand Up @@ -146,4 +146,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
7 changes: 4 additions & 3 deletions examples/src/examples/gizmos/transform-rotate.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, LabelGroup, Panel, ColorPicker, SliderInput, SelectInput, BooleanInput } = ReactPCUI;
const { useState } = React;

const [proj, setProj] = React.useState(pc.PROJECTION_PERSPECTIVE);
const [proj, setProj] = useState(pc.PROJECTION_PERSPECTIVE);

return fragment(
jsx(
Expand Down Expand Up @@ -176,4 +177,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
7 changes: 4 additions & 3 deletions examples/src/examples/gizmos/transform-scale.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, LabelGroup, Panel, ColorPicker, SliderInput, SelectInput, BooleanInput } = ReactPCUI;
const { useState } = React;

const [proj, setProj] = React.useState(pc.PROJECTION_PERSPECTIVE);
const [proj, setProj] = useState(pc.PROJECTION_PERSPECTIVE);

return fragment(
jsx(
Expand Down Expand Up @@ -198,4 +199,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
7 changes: 4 additions & 3 deletions examples/src/examples/gizmos/transform-translate.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, LabelGroup, Panel, ColorPicker, SliderInput, SelectInput, BooleanInput } = ReactPCUI;
const { useState } = React;

const [proj, setProj] = React.useState(pc.PROJECTION_PERSPECTIVE);
const [proj, setProj] = useState(pc.PROJECTION_PERSPECTIVE);

return fragment(
jsx(
Expand Down Expand Up @@ -218,4 +219,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/graphics/ambient-occlusion.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, BooleanInput, LabelGroup, Panel, SelectInput, SliderInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -95,4 +95,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/graphics/asset-viewer.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { Panel, Button } = ReactPCUI;
return jsx(
Panel,
Expand All @@ -16,4 +16,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
onClick: () => observer.emit('next')
})
);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, LabelGroup, Panel, SliderInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -32,4 +32,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, BooleanInput, LabelGroup, Panel, SelectInput, SliderInput } = ReactPCUI;
return jsx(
Panel,
Expand Down Expand Up @@ -55,4 +55,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
})
)
);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, BooleanInput, Button, Label, LabelGroup, Panel, SelectInput, SliderInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -138,4 +138,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, LabelGroup, Panel, SliderInput, SelectInput, BooleanInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -163,4 +163,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, LabelGroup, Panel, SliderInput, BooleanInput, SelectInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -62,4 +62,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/graphics/ground-fog.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, BooleanInput, LabelGroup } = ReactPCUI;
return jsx(
LabelGroup,
Expand All @@ -16,4 +16,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
}
})
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/graphics/integer-textures.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, jsx, fragment }) => {
const { BindingTwoWay, Container, Button, LabelGroup, Panel, SliderInput, SelectInput } = ReactPCUI;

return fragment(
Expand Down Expand Up @@ -47,4 +47,4 @@ export function controls({ observer, ReactPCUI, jsx, fragment }) {
)
)
);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, BooleanInput, LabelGroup, Panel, SliderInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -132,4 +132,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/graphics/lights-baked-a-o.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, BooleanInput, Label, LabelGroup, Panel, SliderInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -186,4 +186,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/graphics/lights.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, BooleanInput, LabelGroup, Panel, SliderInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -109,4 +109,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/graphics/multi-view.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as pc from 'playcanvas';
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, LabelGroup, Panel, SelectInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -34,4 +34,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/graphics/particles-mesh.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, LabelGroup, Panel, SliderInput, BooleanInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -59,4 +59,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
4 changes: 2 additions & 2 deletions examples/src/examples/graphics/post-effects.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @param {import('../../app/components/Example.mjs').ControlOptions} options - The options.
* @returns {JSX.Element} The returned JSX Element.
*/
export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
const { BindingTwoWay, BooleanInput, LabelGroup, Panel, SelectInput, SliderInput } = ReactPCUI;
return fragment(
jsx(
Expand Down Expand Up @@ -192,4 +192,4 @@ export function controls({ observer, ReactPCUI, React, jsx, fragment }) {
)
)
);
}
};
Loading