Jump to content

Gui OVERLAP alignment flag


photo

Recommended Posts

Hello,

I am using the OVERLAP alignment flag (with BACKGROUND) to have an object in the background of my box. It works until my box is resized, in which case, any object with OVERLAP as a flag will not get resized, even if the EXPAND is set.

Is this intentional behavior? How do i get a resizable background Sprite sits in the background of a Gui element?

Cheers

Paul

Link to comment

Hi Paul,

How do i get a resizable background Sprite sits in the background of a Gui element?
Just use this: widget->addChild(background_sprite->getWidget(), Gui::ALIGN_BACKGROUND | Gui::ALIGN_EXPAND);
ALIGN_OVERLAP overrides ALIGN_EXPAND.

Best regards,
Alexander

Link to comment

Thanks for the response!

But the Sprite in this case will not sit in the background, it will sit alongside anything else added to the Gui item (In my case, a scroller). Setting OVERLAP will allow any added items to the scroller to overlap the sprite.

Basically, what i am trying to do, is have a GuiScrollBox, with a black background, with a Canvas on top.

Any help would be appreciated.

Link to comment
×
×
  • Create New...