class Button2 : Button // Create a new class extending the default Gui Button
{
virtual void update(C GuiPC &gpc) // extend updating object
{
super.update(gpc); // call default method
}
virtual void draw(C GuiPC &gpc) // extend drawing object
{
if(gpc.visible && visible()) // if parents are visible and this object is visible too
{
D.clip(gpc.clip); // clip display drawing to given clipping rectangle, this is needed for example when object is inside a window, and is partially hidden because the parent's rectangle doesn't fully cover this object
//here you draw your progress bar
//and then your text
D.text(rect().center()+gpc.offset, text); // draw button's text, at center of rectangle and again moved by 'gpc.offset'
}
}
}