Skip to content

Update UILargeButton to handle all anchors #273

@robojumper

Description

@robojumper

UILargeButton has a function RefreshLocationBasedOnAnchor that makes it look nice when anchored.

Unfortunately, that's only implemented for Bottom_Right, Middle_Center, Bottom_Center, Top_Center.

simulated function RefreshLocationBasedOnAnchor()
{
	switch( anchor )
	{
	case class'UIUtilities'.const.ANCHOR_BOTTOM_RIGHT:
		SetPosition(-Width - 12 + OffsetX, -Height - 12 + OffsetY); // giving it a little breathing space to edge of screen, aligned with shortcut hud. 
		break;
	case class'UIUtilities'.const.ANCHOR_MIDDLE_CENTER:
		SetPosition(-Width * 0.5 + OffsetX, -Height * 0.5 + OffsetY);
		break;
	case class'UIUtilities'.const.ANCHOR_BOTTOM_CENTER:
		SetPosition(-Width * 0.5 + OffsetX, -Height + OffsetY);
		break;
	case class'UIUtilities'.const.ANCHOR_TOP_CENTER:
		SetPosition(-Width * 0.5 + OffsetX, OffsetY);
		break;
	}
	if(bHideUntilRealized)
		Show();
}

It should be expanded for every anchor.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions