Skip to content

GetSize

otvv edited this page Jul 19, 2020 · 5 revisions

CWidgets::GetSize

What it does:

This function returns the current size of the widget.

What it returns:

This function returns a FGUI::DIMENSION instance. (width, height)

Widgets:

List of widgets that are using this function:

  • All of them.

Example:

Let's say I want to add a second widget 20 pixels below the first one.

First I would get the first widget y position and then sum with the first widget size and then I put the amount of "spacing" I want to have of one widget to another. (In that case 20px.)

buildrPattern.Widget(SecondButton).Title("Click me!").Font("Tahoma", 12, true).Position(30, (FirstButton->GetPosition().m_iY + FirstButton->GetSize().m_iHeight) + 20).SpawnIn(Container);

What's next?

Next you will learn about the GetTitle function.