Ayaz
I managed to add a component. With this we should be able to add more complex things. It's mostly the same as what you have except I added the monogatari.registerComponent(<Custom Class Here>) function.
This is what I have inside of the monogatari.init function in the main.js
class custom extends Monogatari.ScreenComponent{
render () {
return `
<h1>Test header</h1>
`;
}
}
custom.tag = 'custom-screen';
monogatari.registerComponent (custom);
// Jump to particular Lable for testing
// ***' monogatari.run("jump BattleTestLoop") '***
monogatari.component('main-menu').addButton ({
string: 'clickMe',
data: {
action:"open-screen",
open:"custom"
}
});
When it compiles it should show up as
<custom-screen class="animated active" data-component="custom-screen" data-screen="custom"><h1>Test header</h1></custom-screen>
inside of the game when you inspect element. I'm gonna mess around with some CSS styings on it right now but I managed to get the Test header to display without showing up in the main-screen so that's a WIN!!