Skip to content

Commit b5e050d

Browse files
author
Roberto De Ioris
authored
Update Slate_API.md
1 parent bbcdfe1 commit b5e050d

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

‎docs/Slate_API.md‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,67 @@ Now slot attributes should be more clear. Note that SBorder has a set_content()
232232
SBorder()(STextBlock(text='Hello i am an STextBlock [line 0]'))
233233
```
234234

235+
The list of FArguments for SBorder is avalable here: https://api.unrealengine.com/INT/API/Runtime/Slate/Widgets/Layout/SBorder/FArguments/
236+
235237
## Padding
236238

239+
The padding attributes of slots, defines their margin size.
240+
241+
Padding in the python api accepts various forms:
242+
243+
```python
244+
from unreal_engine import SWindow, STextBlock, SVerticalBox, SBorder
245+
from unreal_engine.enums import EVerticalAlignment, EHorizontalAlignment
246+
247+
window = SWindow(client_size=(512, 512), title='First Slate Window')
248+
249+
vertical_box = SVerticalBox()
250+
251+
vertical_box.add_slot(SBorder()(STextBlock(text='Hello i am an STextBlock [line 0]')), padding=100, v_align=EVerticalAlignment.VAlign_Fill)
252+
253+
window.set_content(SBorder()(vertical_box))
254+
```
255+
256+
passing a single float will specify the same amount of units for top, left, bottom and right:
257+
258+
![Padding](https://github.com/20tab/UnrealEnginePython/raw/master/docs/screenshots/slate_Padding.png)
259+
260+
```python
261+
from unreal_engine import SWindow, STextBlock, SVerticalBox, SBorder
262+
from unreal_engine.enums import EVerticalAlignment, EHorizontalAlignment
263+
264+
window = SWindow(client_size=(512, 512), title='First Slate Window')
265+
266+
vertical_box = SVerticalBox()
267+
268+
vertical_box.add_slot(SBorder()(STextBlock(text='Hello i am an STextBlock [line 0]')), padding=(100, 100), v_align=EVerticalAlignment.VAlign_Fill)
269+
270+
window.set_content(SBorder()(vertical_box))
271+
```
272+
273+
a 2-items float tuple will specify top and left and will force bottom and right to 0:
274+
275+
![Padding 2](https://github.com/20tab/UnrealEnginePython/raw/master/docs/screenshots/slate_Padding2.png)
276+
277+
```python
278+
from unreal_engine import SWindow, STextBlock, SVerticalBox, SBorder
279+
from unreal_engine.enums import EVerticalAlignment, EHorizontalAlignment
280+
281+
window = SWindow(client_size=(512, 512), title='First Slate Window')
282+
283+
vertical_box = SVerticalBox()
284+
285+
vertical_box.add_slot(SBorder()(STextBlock(text='Hello i am an STextBlock [line 0]')), padding=(100, 100, 30, 30), v_align=EVerticalAlignment.VAlign_Fill)
286+
287+
window.set_content(SBorder()(vertical_box))
288+
```
289+
290+
We have alredy seen the 4-items float tuple for specifying top, left, bottom and right:
291+
292+
![Padding 3](https://github.com/20tab/UnrealEnginePython/raw/master/docs/screenshots/slate_Padding3.png)
293+
294+
295+
237296
## SHorizontalBox
238297

239298
## SButton

0 commit comments

Comments
 (0)