0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【UE4:エディタ拡張】左右にレイアウトを揃える

Last updated at Posted at 2020-04-05

ue4.24.3

もっといい方法があるかもだけど
左右にそれぞれ複数ウィジェットを揃えたい場合
こんな感じでいけた

sample
SNew(SVerticalBox)
+ SVerticalBox::Slot().AutoHeight()
[
	SNew(SHorizontalBox)
	+ SHorizontalBox::Slot().HAlign(HAlign_Left)
	[
		// 左揃え
		SNew(SHorizontalBox)
		+ SHorizontalBox::Slot()
		[
			SNew(SButton).Text(LOCTEXT("LeftButton1", "LeftButton1")).OnClicked_Raw(this, &FSample::OnButtonClicked)
		]
		+ SHorizontalBox::Slot()
		[
			SNew(SButton).Text(LOCTEXT("LeftButton2", "LeftButton2")).OnClicked_Raw(this, &FSample::OnButtonClicked)
		]
		+ SHorizontalBox::Slot()
		[
			SNew(SButton).Text(LOCTEXT("LeftButton3", "LeftButton3")).OnClicked_Raw(this, &FSample::OnButtonClicked)
		]
	]

	+ SHorizontalBox::Slot().HAlign(HAlign_Right)
	[
		// 右揃え
		SNew(SHorizontalBox)
		+ SHorizontalBox::Slot()
		[
			SNew(SButton).Text(LOCTEXT("RightButton1", "RightButton1")).OnClicked_Raw(this, &FSample::OnButtonClicked)
		]
		+ SHorizontalBox::Slot()
		[
			SNew(SButton).Text(LOCTEXT("RightButton2", "RightButton2")).OnClicked_Raw(this, &FSample::OnButtonClicked)
		]
	]
]

ue4_align.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?