Skip to content

ViewportTexture

Eduard Gushchin edited this page Jun 21, 2026 · 5 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.ViewportTexture
Namespace Electron2D
Kind class
Category Rendering

Overview

Provides an Electron2D dynamic texture for the contents of a Electron2D.Viewport.

Syntax

public sealed class Electron2D.ViewportTexture : Electron2D.Texture2D

Remarks

A viewport texture is created by Electron2D.Viewport.GetTexture and is local to the scene that owns the viewport. It reports the viewport's current size when queried.

Electron2D 0.1.0 Preview does not expose public GPU texture handles or image readback through this type. Pixel opacity queries therefore return false.

Thread Safety

This type is not synchronized. Query and mutate the owning viewport on the main scene thread.

Since

This type is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Texture2D
  • Electron2D.Viewport

Members

Member Kind Summary
GetHeight() Method Gets the current viewport height in pixels.
GetWidth() Method Gets the current viewport width in pixels.
HasAlpha() Method Checks whether the viewport texture has an alpha channel.
IsPixelOpaque(System.Int32, System.Int32) Method Checks whether a viewport texture pixel is fully opaque.

Member Details

GetHeight()

Kind: Method

public System.Int32 GetHeight()()

Summary

Gets the current viewport height in pixels.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

The owning viewport height in pixels, clamped to 0 for invalid negative sizes.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.ViewportTexture

GetWidth()

Kind: Method

public System.Int32 GetWidth()()

Summary

Gets the current viewport width in pixels.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

The owning viewport width in pixels, clamped to 0 for invalid negative sizes.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.ViewportTexture

HasAlpha()

Kind: Method

public System.Boolean HasAlpha()()

Summary

Checks whether the viewport texture has an alpha channel.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

true, because Electron2D viewport textures are treated as alpha-capable render targets.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.ViewportTexture

IsPixelOpaque(System.Int32, System.Int32)

Kind: Method

public System.Boolean IsPixelOpaque(System.Int32, System.Int32)(System.Int32 x, System.Int32 y)

Summary

Checks whether a viewport texture pixel is fully opaque.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • x: The pixel X coordinate in viewport texture space.
  • y: The pixel Y coordinate in viewport texture space.

Returns

false until public image readback is available.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.ViewportTexture

Clone this wiki locally