Skip to content

Texture2D

Eduard Gushchin edited this page Jul 1, 2026 · 5 revisions

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

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

Overview

Provides the Electron2D base resource for 2D textures.

Syntax

public abstract class Electron2D.Texture2D : Electron2D.Resource

Godot 4.7 C# profile compatibility

Profile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: Texture2D

Abstract texture resource baseline for size, alpha, mipmaps and pixel opacity queries.

Remarks

Texture2D describes texture metadata and transparency queries. Concrete texture loaders and image-backed texture classes are intentionally separate from this base type.

Electron2D 0.1.0 Preview does not expose image import through this type. PNG/JPEG import and concrete image texture creation are handled by later resource pipeline tasks.

Thread Safety

Read-only metadata queries are safe to call from any thread when the concrete texture implementation is immutable.

Since

This type is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.AtlasTexture

Members

Member Kind Summary
Electron2D.Texture2D() Constructor Initializes a new instance of the Texture2D type.
GetHeight() Method Gets the texture height in pixels.
GetMipmapCount() Method Gets the number of mipmap levels available on this texture.
GetSize() Method Gets the texture size in pixels.
GetWidth() Method Gets the texture width in pixels.
HasAlpha() Method Checks whether the texture contains an alpha channel.
HasMipmaps() Method Checks whether the texture contains mipmaps.
IsPixelOpaque(System.Int32, System.Int32) Method Checks whether a texture pixel is fully opaque.

Member Details

Electron2D.Texture2D()

Kind: Constructor

public Electron2D.Texture2D()

Summary

Initializes a new instance of the Texture2D type.

Remarks

The new instance follows the lifetime and validation rules of its declaring type.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Texture2D

GetHeight()

Kind: Method

public System.Int32 GetHeight()()

Summary

Gets the texture height in pixels.

Remarks

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

Returns

The texture height in pixels, or 0 for an empty texture.

Thread Safety

This method is safe to call from any thread when the concrete texture is immutable.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Texture2D

GetMipmapCount()

Kind: Method

public System.Int32 GetMipmapCount()()

Summary

Gets the number of mipmap levels available on this texture.

Remarks

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

Returns

The number of mipmap levels, or 0 when no mipmaps are available.

Thread Safety

This method is safe to call from any thread when the concrete texture is immutable.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Texture2D.HasMipmaps

GetSize()

Kind: Method

public Electron2D.Vector2 GetSize()()

Summary

Gets the texture size in pixels.

Remarks

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

Returns

A vector whose X component is the width and Y component is the height.

Thread Safety

This method is safe to call from any thread when the concrete texture is immutable.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Texture2D.GetHeight
  • Electron2D.Texture2D.GetWidth

GetWidth()

Kind: Method

public System.Int32 GetWidth()()

Summary

Gets the texture width in pixels.

Remarks

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

Returns

The texture width in pixels, or 0 for an empty texture.

Thread Safety

This method is safe to call from any thread when the concrete texture is immutable.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Texture2D

HasAlpha()

Kind: Method

public System.Boolean HasAlpha()()

Summary

Checks whether the texture contains an alpha channel.

Remarks

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

Returns

true if the texture has an alpha channel; otherwise, false.

Thread Safety

This method is safe to call from any thread when the concrete texture is immutable.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Texture2D

HasMipmaps()

Kind: Method

public System.Boolean HasMipmaps()()

Summary

Checks whether the texture contains mipmaps.

Remarks

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

Returns

true if the texture has mipmaps; otherwise, false.

Thread Safety

This method is safe to call from any thread when the concrete texture is immutable.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Texture2D.GetMipmapCount

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 texture pixel is fully opaque.

Remarks

The base implementation treats textures without alpha as opaque inside their bounds and treats alpha textures as not opaque unless a concrete implementation overrides the query.

Parameters

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

Returns

true if the pixel is inside the texture and fully opaque; otherwise, false.

Thread Safety

This method is safe to call from any thread when the concrete texture is immutable.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Texture2D.HasAlpha

Clone this wiki locally