Skip to content

DisplayServer

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

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

Field Value
Full name Electron2D.DisplayServer
Namespace Electron2D
Kind class
Category Display and Localization

Overview

Provides display, orientation and virtual keyboard state.

Syntax

public static class Electron2D.DisplayServer

Godot 4.7 C# profile compatibility

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

Display safe area, screen orientation and virtual keyboard request state without public native handles.

Remarks

The 0.1.0 Preview implementation stores a compact process-wide state used by mobile input and export pipelines. Platform backends feed this state through internal methods; public methods expose stable values without native handles.

Thread Safety

All methods synchronize access to process-wide display state.

Since

This class is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.InputEventScreenDrag
  • Electron2D.InputEventScreenTouch

Members

Member Kind Summary
GetDisplaySafeArea() Method Gets the current display safe area.
ScreenGetOrientation(System.Int32) Method Gets the current screen orientation state.
ScreenSetOrientation(Electron2D.DisplayServer.ScreenOrientation, System.Int32) Method Sets the requested screen orientation state.
VirtualKeyboardGetHeight() Method Gets the current virtual keyboard height.
VirtualKeyboardHide() Method Hides the virtual keyboard.
VirtualKeyboardShow(System.String, Electron2D.Rect2, Electron2D.DisplayServer.VirtualKeyboardType, System.Int32, System.Int32, System.Int32) Method Shows the virtual keyboard.

Member Details

GetDisplaySafeArea()

Kind: Method

public static Electron2D.Rect2I GetDisplaySafeArea()()

Summary

Gets the current display safe area.

Remarks

The returned rectangle is a snapshot. Platform updates that arrive later do not mutate previously returned values.

Returns

The unobscured display area, or an empty rectangle when the platform has not reported one.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.DisplayServer

ScreenGetOrientation(System.Int32)

Kind: Method

public static Electron2D.DisplayServer.ScreenOrientation ScreenGetOrientation(System.Int32)(System.Int32 screen)

Summary

Gets the current screen orientation state.

Remarks

The screen parameter is accepted for API compatibility with future multi-screen support and is ignored in this baseline.

Parameters

  • screen: The screen index. The 0.1.0 Preview stores one process-wide state.

Returns

The current screen orientation.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.DisplayServer.ScreenSetOrientation(Electron2D.DisplayServer.ScreenOrientation,System.Int32)

ScreenSetOrientation(Electron2D.DisplayServer.ScreenOrientation, System.Int32)

Kind: Method

public static System.Void ScreenSetOrientation(Electron2D.DisplayServer.ScreenOrientation, System.Int32)(Electron2D.DisplayServer.ScreenOrientation orientation, System.Int32 screen)

Summary

Sets the requested screen orientation state.

Remarks

Invalid enum values are ignored. The request is recorded for the platform backend but does not expose any native display object through public API.

Parameters

  • orientation: The requested orientation.
  • screen: The screen index. The 0.1.0 Preview stores one process-wide state.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.DisplayServer.ScreenGetOrientation(System.Int32)

VirtualKeyboardGetHeight()

Kind: Method

public static System.Int32 VirtualKeyboardGetHeight()()

Summary

Gets the current virtual keyboard height.

Remarks

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

Returns

The last reported virtual keyboard height in pixels, or 0 when the virtual keyboard is hidden or unsupported.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.DisplayServer.VirtualKeyboardHide
  • Electron2D.DisplayServer.VirtualKeyboardShow(System.String,Electron2D.Rect2,Electron2D.DisplayServer.VirtualKeyboardType,System.Int32,System.Int32,System.Int32)

VirtualKeyboardHide()

Kind: Method

public static System.Void VirtualKeyboardHide()()

Summary

Hides the virtual keyboard.

Remarks

This call clears the stored keyboard request and resets the reported height to zero. Unsupported platforms treat it as a no-op.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.DisplayServer.VirtualKeyboardShow(System.String,Electron2D.Rect2,Electron2D.DisplayServer.VirtualKeyboardType,System.Int32,System.Int32,System.Int32)

VirtualKeyboardShow(System.String, Electron2D.Rect2, Electron2D.DisplayServer.VirtualKeyboardType, System.Int32, System.Int32, System.Int32)

Kind: Method

public static System.Void VirtualKeyboardShow(System.String, Electron2D.Rect2, Electron2D.DisplayServer.VirtualKeyboardType, System.Int32, System.Int32, System.Int32)(System.String existingText, Electron2D.Rect2 position, Electron2D.DisplayServer.VirtualKeyboardType type, System.Int32 maxLength, System.Int32 cursorStart, System.Int32 cursorEnd)

Summary

Shows the virtual keyboard.

Remarks

This method records the request for the platform backend. Passing null for existingText stores an empty string. Invalid keyboard types fall back to Electron2D.DisplayServer.VirtualKeyboardType.Default.

Parameters

  • existingText: The text already present in the edited control.
  • position: The edited control rectangle in window coordinates.
  • type: The requested virtual keyboard layout.
  • maxLength: The maximum accepted text length, or -1 for unlimited input.
  • cursorStart: The start of the current selection, or -1 when unknown.
  • cursorEnd: The end of the current selection, or -1 when unknown.

Thread Safety

This method is safe to call from any thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.DisplayServer.VirtualKeyboardGetHeight
  • Electron2D.DisplayServer.VirtualKeyboardHide

Clone this wiki locally