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

Transforms absolute coordinates into local coordinates

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

Transforms 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 scalar_absolute_to_local(geometry, absolute_scalar) float

Transforms a scalar from absolute space to local space

Parameters:
Return type:

float

classmethod scalar_local_to_absolute(geometry, local_scalar) float

Transforms a scalar from local space to absolute space

Parameters:
Return type:

float

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:
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 deprecated: Returns inverted results. Replace with ‘Local to Absolute (Scalar)’

Parameters:
Return type:

float

classmethod transform_scalar_local_to_absolute(geometry, local_scalar) float

Transform Scalar Local to Absolute deprecated: Returns inverted results. Replace with ‘Absolute To Local (Scalar)’

Parameters:
Return type:

float

classmethod transform_vector_absolute_to_local(geometry, absolute_vector) Vector2D

Transform Vector Absolute to Local deprecated: Returns inverted results. Replace with ‘Local to Absolute (Vector)’

Parameters:
Return type:

Vector2D

classmethod transform_vector_local_to_absolute(geometry, local_vector) Vector2D

Transform Vector Local to Absolute deprecated: Returns inverted results. Replace with ‘Absolute To Local (Vector)’

Parameters:
Return type:

Vector2D

classmethod vector_absolute_to_local(geometry, absolute_vector) Vector2D

Transforms a vector from absolute space to local space

Parameters:
Return type:

Vector2D

classmethod vector_local_to_absolute(geometry, local_vector) Vector2D

Transforms a vector from local space to absolute space

Parameters:
Return type:

Vector2D