Pixel Streaming Commands
info
This page shows an example of sending a command from MetaEditor to Unreal Engine.
Hooks.actions()
Allows you to send commands to the Unreal Engine.
Commands.tsx
import { Hooks } from "pixel-streaming";
export default function MyActions() {
const { emitUi, emitSys } = Hooks.actions();
const handleUi = () => {
const payload = {demo: true}
const options = {
debug: true,
duration: 1000,
placement: 'topCenter',
}
emitUi(payload, options)
}
const handleSys = () => {
const payload = {anyKey: 'anything'}
emitSys(payload)
}
return (...)
}
Emit / Options config
This parameter is optional.
Example: actions.emitUi(payload, {debug: true})
Name | Description |
---|---|
debug? | boolean — If any value is passed, it is used in higher precedence, even if debugMode={false} |
duration? | number — How long to keep a notification (ms) |
placement? | string — Where to display notification (`'topCenter' |