Skip to content

Instantly share code, notes, and snippets.

@ndugger
Last active June 23, 2019 05:05
Show Gist options
  • Save ndugger/5d456fac25b46643b070cb2f717e5f41 to your computer and use it in GitHub Desktop.
Save ndugger/5d456fac25b46643b070cb2f717e5f41 to your computer and use it in GitHub Desktop.
import * as Bifrost from 'bifrost';
export default class MainMenu extends Bifrost.GUI.Control {
private handleButtonClick(event: Event): void {
console.log('Button Click:', event);
}
public render(): Bifrost.GUI.Control.Tree {
return [
<HTMLButtonElement onclick={ (e: Event) => this.handleButtonClick(e) }>
Click Here
</HTMLButtonElement>
];
}
public theme(): Bifrost.GUI.Control.Style {
return `
.${ HTMLButtonElement.name } {
background: blue;
color: white;
}
`;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment