Skip to content

GetPosition

otvv edited this page Jul 19, 2020 · 13 revisions

CWidgets::GetPosition

What it does:

This function returns the current position of the widget inside the Container.

What it returns:

This function returns a FGUI::POINT instance. (x, y)

NOTE: This function doesn't return the widget absolute position (Container + Widget), but the widget initial position.

Widgets:

List of widgets that are using this function:

  • All of them.

Example:

Let's say I want to add a second widget at the same y position of the first widget.

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

This is just a example where this function might be useful. You don't need to use this to assemble your menu.


What's next?

Next you will learn about the GetAbsolutePosition function.