unreal.SlateLibrary

class unreal.SlateLibrary(outer: Object | None = None, name: Name | str = 'None')

Bases: BlueprintFunctionLibrary

Slate Blueprint Library

C++ Source:

  • Module: UMG

  • File: SlateBlueprintLibrary.h

classmethod absolute_to_local(geometry, absolute_coordinate) Vector2D

Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.

Parameters:
Returns:

Transforms AbsoluteCoordinate into the local space of this Geometry.

Return type:

Vector2D

classmethod absolute_to_viewport(world_context_object, absolute_desktop_coordinate) -> (pixel_position=Vector2D, viewport_position=Vector2D)

Translates absolute coordinate in desktop space of the geometry provided into local viewport coordinates.

Parameters:
  • world_context_object (Object) –

  • absolute_desktop_coordinate (Vector2D) –

Returns:

pixel_position (Vector2D): The position in the game’s viewport, usable for line traces and other uses where you need a coordinate in the space of viewport resolution units.

viewport_position (Vector2D): The position in the space of other widgets in the viewport. Like if you wanted to add another widget to the viewport at the same position in viewport space as this location, this is what you would use.

Return type:

tuple

classmethod equal_equal_slate_brush(a, b) bool

Returns whether brushes A and B are identical.

Parameters:
Return type:

bool

classmethod get_absolute_size(geometry) Vector2D

Returns the size of the geometry in absolute space.

Parameters:

geometry (Geometry) –

Return type:

Vector2D

classmethod get_local_size(geometry) Vector2D

Returns the size of the geometry in local space.

Parameters:

geometry (Geometry) –

Return type:

Vector2D

classmethod get_local_top_left(geometry) Vector2D

Returns the local top/left of the geometry in local space.

Parameters:

geometry (Geometry) –

Return type:

Vector2D

classmethod is_under_location(geometry, absolute_coordinate) bool

Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.

Parameters:
Returns:

true if the provided location in absolute coordinates is within the bounds of this geometry.

Return type:

bool

classmethod local_to_absolute(geometry, local_coordinate) Vector2D

Translates local coordinates into absolute coordinates

Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.

Parameters:
Returns:

Absolute coordinates

Return type:

Vector2D

classmethod local_to_viewport(world_context_object, geometry, local_coordinate) -> (pixel_position=Vector2D, viewport_position=Vector2D)

Translates local coordinate of the geometry provided into local viewport coordinates.

Parameters:
Returns:

pixel_position (Vector2D): The position in the game’s viewport, usable for line traces and other uses where you need a coordinate in the space of viewport resolution units.

viewport_position (Vector2D): The position in the space of other widgets in the viewport. Like if you wanted to add another widget to the viewport at the same position in viewport space as this location, this is what you would use.

Return type:

tuple

classmethod screen_to_viewport(world_context_object, screen_position) Vector2D

Translates a screen position in pixels into the local space of the viewport widget.

Parameters:
Returns:

viewport_position (Vector2D):

Return type:

Vector2D

classmethod screen_to_widget_absolute(world_context_object, screen_position, include_window_position=False) Vector2D

Translates a screen position in pixels into absolute application coordinates. If bIncludeWindowPosition is true, then this method will also remove the game window’s position (useful when in windowed mode).

Parameters:
  • world_context_object (Object) –

  • screen_position (Vector2D) –

  • include_window_position (bool) –

Returns:

absolute_coordinate (Vector2D):

Return type:

Vector2D

classmethod screen_to_widget_local(world_context_object, geometry, screen_position, include_window_position=False) Vector2D

Translates a screen position in pixels into the local space of a widget with the given geometry. If bIncludeWindowPosition is true, then this method will also remove the game window’s position (useful when in windowed mode).

Parameters:
Returns:

local_coordinate (Vector2D):

Return type:

Vector2D

classmethod transform_scalar_absolute_to_local(geometry, absolute_scalar) float

Transform Scalar Absolute to Local

Parameters:
Return type:

float

classmethod transform_scalar_local_to_absolute(geometry, local_scalar) float

Transform Scalar Local to Absolute

Parameters:
Return type:

float

classmethod transform_vector_absolute_to_local(geometry, absolute_vector) Vector2D

Transform Vector Absolute to Local

Parameters:
Return type:

Vector2D

classmethod transform_vector_local_to_absolute(geometry, local_vector) Vector2D

Transform Vector Local to Absolute

Parameters:
Return type:

Vector2D