Skip to content

RectangleShape2D

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

RectangleShape2D

Back to API Reference

Namespace: Electron2D

Summary

Provides a rectangular 2D physics shape resource.

Declaration

public sealed class Electron2D.RectangleShape2D : Electron2D.Shape2D

Remarks

The rectangle is centered on the owning Electron2D.CollisionShape2D and uses the Electron2D.RectangleShape2D.Size property as its full width and height.

Thread Safety

This type is not synchronized. Create and mutate resources on the main scene thread.

Since

This type is available since Electron2D 0.1.0 Preview.

Members

Member Kind Summary
Size Property Gets or sets the full width and height of the rectangle.
Electron2D.RectangleShape2D() Constructor Initializes a new instance of the RectangleShape2D type.

Member Details

Size

Kind: Property

public Electron2D.Vector2 Size { get; set; }

Summary

Gets or sets the full width and height of the rectangle.

Remarks

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

Value

A finite vector with positive X and Y values.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.RectangleShape2D

Electron2D.RectangleShape2D()

Kind: Constructor

public Electron2D.RectangleShape2D()

Summary

Initializes a new instance of the RectangleShape2D 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.RectangleShape2D

Clone this wiki locally