Good afternoon, everyone!
I have a question, again:
I tried to create new GUI elements inside a PGButton callback function but it did not work. Is it because I am in the main loop already, when the callback function is executed? What can I do about it?
Here is the callback function (maybe it is another mistake i did not see )
PT(PGVirtualFrame) frame = new PGVirtualFrame();
frame->setup(50, 100);
PGFrameStyle style = frame->get_frame_style(0);
style.set_color(0.5f, 0.7f, 0.5f, 1.0f);
style.set_type(PGFrameStyle::T_flat);
frame->set_frame_style(0, style);
frame->set_frame_style(1, style);
frame->set_frame_style(2, style);
frame->set_frame_style(3, style);
nodes[numNodes - 1] = window->get_aspect_2d().attach_new_node(frame);
nodes[numNodes - 1].set_pos(-1.0, 0.0, -1.0);
nodes[numNodes - 1].set_scale(0.5f);
The nodes array contains all the NodePath variables I use.
I am looking forward to helpful awnsers