TextureScreenOverlay#

class ansys.stk.core.graphics.TextureScreenOverlay#

Bases: IScreenOverlay, IOverlay, IScreenOverlayContainer

A rectangular overlay that can be assigned a texture.

Overview#

texture

Get or set the texture (image) to be drawn on the overlay. Textures can be obtained from textures.

texture_filter

Get or set the filter used for the texture associated with this overlay.

maintain_aspect_ratio

Get or set a value indicating whether the aspect ratio of the texture screen overlay is maintained or not.

Examples#

Draw a new Texture Screen Overlay

# Scenario scenario: Scenario object
manager = scenario.scene_manager
overlays = manager.screen_overlays.overlays
textureOverlay = manager.initializers.texture_screen_overlay.initialize_with_xy_width_height(0, 0, 128, 128)
installPath = r"C:\Program Files\AGI\STK 12" if os.name == "nt" else os.environ["STK_INSTALL_DIR"]
textureOverlay.texture = manager.textures.load_from_string_uri(
    os.path.join(installPath, "STKData", "VO", "Textures", "agilogo3.ppm")
)
textureOverlay.maintain_aspect_ratio = True
textureOverlay.origin = ScreenOverlayOrigin.TOP_LEFT
textureOverlay.position = [
    [0],
    [20],
    [int(ScreenOverlayUnit.PIXEL)],
    [int(ScreenOverlayUnit.PIXEL)],
]
overlays.add(textureOverlay)
# Render the Scene
manager.render()

Import detail#

from ansys.stk.core.graphics import TextureScreenOverlay

Property detail#

property TextureScreenOverlay.texture: RendererTexture2D#

Get or set the texture (image) to be drawn on the overlay. Textures can be obtained from textures.

property TextureScreenOverlay.texture_filter: TextureFilter2D#

Get or set the filter used for the texture associated with this overlay.

property TextureScreenOverlay.maintain_aspect_ratio: OverlayAspectRatioMode#

Get or set a value indicating whether the aspect ratio of the texture screen overlay is maintained or not.