// Implement all the layout/application functions here
CustomLayout::CustomLayout():Layout::Layout(){
// Create the TextBlock instance with the text we want
this->helloText=pu::ui::elm::TextBlock::New(300,300,"Press X to answer my question");
// Add the instance to the layout. IMPORTANT! this MUST be done for them to be used, having them as members is not enough (just a simple way to keep them)
this->Add(this->helloText);
}
voidMainApplication::OnLoad(){
// Create the layout (calling the smart constructor above)
this->layout=CustomLayout::New();
// Load the layout. In applications layouts are loaded, not added into a container (you don't select an added layout, just load it from this function)
// Simply explained: loading layout = the application will render that layout in the very next frame
this->LoadLayout(this->layout);
// Set a function when input is caught. This input handling will be the first one to be handled (before Layout or any Elements)
// Using a lambda function here to simplify things
// You can use member functions via std::bind() C++ wrapper