Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UILargeButton to handle all anchors #273

Open
robojumper opened this issue Aug 1, 2017 · 0 comments
Open

Update UILargeButton to handle all anchors #273

robojumper opened this issue Aug 1, 2017 · 0 comments

Comments

@robojumper
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant