C# Класс SFML.Window.Window

Window is a rendering window ; it can create a new window or connect to an existing one
Наследование: SFML.System.ObjectBase
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Close ( ) : void

Close (destroy) the window. The Window instance remains valid and you can call Create to recreate the window

DispatchEvents ( ) : void

Call the event handlers for each pending event

Display ( ) : void

Display the window on screen

HasFocus ( ) : bool

Check whether the window has the input focus

RequestFocus ( ) : void

Request the current window to be made the active foreground window

SetActive ( ) : bool

Activate the window as the current target for rendering

SetActive ( bool active ) : bool

Activate of deactivate the window as the current target for rendering

SetFramerateLimit ( uint limit ) : void

Limit the framerate to a maximum fixed frequency

SetIcon ( uint width, uint height, byte pixels ) : void

Change the window's icon

SetJoystickThreshold ( float threshold ) : void

Change the joystick threshold, ie. the value below which no move event will be generated

SetKeyRepeatEnabled ( bool enable ) : void

Enable or disable automatic key-repeat. Automatic key-repeat is enabled by default

SetMouseCursorGrabbed ( bool grabbed ) : void

Grab or release the mouse cursor

If set, grabs the mouse cursor inside this window's client area so it may no longer be moved outside its bounds. Note that grabbing is only active while the window has focus and calling this function for fullscreen windows won't have any effect (fullscreen windows always grab the cursor).

SetMouseCursorVisible ( bool show ) : void

Show or hide the mouse cursor

SetTitle ( string title ) : void

Change the title of the window

SetVerticalSyncEnabled ( bool enable ) : void

Enable / disable vertical synchronization

SetVisible ( bool visible ) : void

Show or hide the window

ToString ( ) : string

Provide a string describing the object

WaitAndDispatchEvents ( ) : void

Wait for a new event and dispatch it to the corresponding event handler

Window ( IntPtr handle ) : System

Create the window from an existing control with default creation settings

Window ( IntPtr Handle, ContextSettings settings ) : System

Create the window from an existing control

Window ( VideoMode mode, string title ) : System

Create the window with default style and creation settings

Window ( VideoMode mode, string title, Styles style ) : System

Create the window with default creation settings

Window ( VideoMode mode, string title, Styles style, ContextSettings settings ) : System

Create the window

Защищенные методы

Метод Описание
Destroy ( bool disposing ) : void

Handle the destruction of the object

InternalGetMousePosition ( ) : Vector2i

Internal function to get the mouse position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.

InternalGetTouchPosition ( uint Finger ) : Vector2i

Internal function to get the touch position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.

InternalSetMousePosition ( Vector2i position ) : void

Internal function to set the mouse position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.

PollEvent ( Event &eventToFill ) : bool

Internal function to get the next event (non-blocking)

WaitEvent ( Event &eventToFill ) : bool

Internal function to get the next event (blocking)

Window ( IntPtr cPointer, int dummy ) : System

Constructor for derived classes

Приватные методы

Метод Описание
CallEventHandler ( Event e ) : void

Call the event handler for the given event

sfMouse_getPosition ( IntPtr CPointer ) : Vector2i
sfMouse_setPosition ( Vector2i position, IntPtr CPointer ) : void
sfTouch_getPosition ( uint Finger, IntPtr RelativeTo ) : Vector2i
sfWindow_close ( IntPtr CPointer ) : void
sfWindow_create ( VideoMode Mode, string Title, Styles Style, ContextSettings &Params ) : IntPtr
sfWindow_createFromHandle ( IntPtr Handle, ContextSettings &Params ) : IntPtr
sfWindow_createUnicode ( VideoMode Mode, IntPtr Title, Styles Style, ContextSettings &Params ) : IntPtr
sfWindow_destroy ( IntPtr CPointer ) : void
sfWindow_display ( IntPtr CPointer ) : void
sfWindow_getFrameTime ( IntPtr CPointer ) : uint
sfWindow_getPosition ( IntPtr CPointer ) : Vector2i
sfWindow_getSettings ( IntPtr CPointer ) : ContextSettings
sfWindow_getSize ( IntPtr CPointer ) : Vector2u
sfWindow_getSystemHandle ( IntPtr CPointer ) : IntPtr
sfWindow_hasFocus ( IntPtr CPointer ) : bool
sfWindow_isOpen ( IntPtr CPointer ) : bool
sfWindow_pollEvent ( IntPtr CPointer, Event &Evt ) : bool
sfWindow_requestFocus ( IntPtr CPointer ) : void
sfWindow_setActive ( IntPtr CPointer, bool Active ) : bool
sfWindow_setFramerateLimit ( IntPtr CPointer, uint Limit ) : void
sfWindow_setIcon ( IntPtr CPointer, uint Width, uint Height, byte Pixels ) : void
sfWindow_setJoystickThreshold ( IntPtr CPointer, float Threshold ) : void
sfWindow_setKeyRepeatEnabled ( IntPtr CPointer, bool Enable ) : void
sfWindow_setMouseCursorGrabbed ( IntPtr CPointer, bool grabbed ) : void
sfWindow_setMouseCursorVisible ( IntPtr CPointer, bool Show ) : void
sfWindow_setPosition ( IntPtr CPointer, Vector2i position ) : void
sfWindow_setSize ( IntPtr CPointer, Vector2u size ) : void
sfWindow_setTitle ( IntPtr CPointer, string title ) : void
sfWindow_setUnicodeTitle ( IntPtr CPointer, IntPtr title ) : void
sfWindow_setVerticalSyncEnabled ( IntPtr CPointer, bool Enable ) : void
sfWindow_setVisible ( IntPtr CPointer, bool visible ) : void
sfWindow_waitEvent ( IntPtr CPointer, Event &Evt ) : bool

Описание методов

Close() публичный Метод

Close (destroy) the window. The Window instance remains valid and you can call Create to recreate the window
public Close ( ) : void
Результат void

Destroy() защищенный Метод

Handle the destruction of the object
protected Destroy ( bool disposing ) : void
disposing bool Is the GC disposing the object, or is it an explicit call ?
Результат void

DispatchEvents() публичный Метод

Call the event handlers for each pending event
public DispatchEvents ( ) : void
Результат void

Display() публичный Метод

Display the window on screen
public Display ( ) : void
Результат void

HasFocus() публичный Метод

Check whether the window has the input focus
public HasFocus ( ) : bool
Результат bool

InternalGetMousePosition() защищенный Метод

Internal function to get the mouse position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.
protected InternalGetMousePosition ( ) : Vector2i
Результат Vector2i

InternalGetTouchPosition() защищенный Метод

Internal function to get the touch position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.
protected InternalGetTouchPosition ( uint Finger ) : Vector2i
Finger uint Finger index
Результат Vector2i

InternalSetMousePosition() защищенный Метод

Internal function to set the mouse position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.
protected InternalSetMousePosition ( Vector2i position ) : void
position Vector2i Relative mouse position
Результат void

PollEvent() защищенный Метод

Internal function to get the next event (non-blocking)
protected PollEvent ( Event &eventToFill ) : bool
eventToFill Event Variable to fill with the raw pointer to the event structure
Результат bool

RequestFocus() публичный Метод

Request the current window to be made the active foreground window
public RequestFocus ( ) : void
Результат void

SetActive() публичный Метод

Activate the window as the current target for rendering
public SetActive ( ) : bool
Результат bool

SetActive() публичный Метод

Activate of deactivate the window as the current target for rendering
public SetActive ( bool active ) : bool
active bool True to activate, false to deactivate (true by default)
Результат bool

SetFramerateLimit() публичный Метод

Limit the framerate to a maximum fixed frequency
public SetFramerateLimit ( uint limit ) : void
limit uint Framerate limit, in frames per seconds (use 0 to disable limit)
Результат void

SetIcon() публичный Метод

Change the window's icon
public SetIcon ( uint width, uint height, byte pixels ) : void
width uint Icon's width, in pixels
height uint Icon's height, in pixels
pixels byte Array of pixels, format must be RGBA 32 bits
Результат void

SetJoystickThreshold() публичный Метод

Change the joystick threshold, ie. the value below which no move event will be generated
public SetJoystickThreshold ( float threshold ) : void
threshold float New threshold, in range [0, 100]
Результат void

SetKeyRepeatEnabled() публичный Метод

Enable or disable automatic key-repeat. Automatic key-repeat is enabled by default
public SetKeyRepeatEnabled ( bool enable ) : void
enable bool True to enable, false to disable
Результат void

SetMouseCursorGrabbed() публичный Метод

Grab or release the mouse cursor
If set, grabs the mouse cursor inside this window's client area so it may no longer be moved outside its bounds. Note that grabbing is only active while the window has focus and calling this function for fullscreen windows won't have any effect (fullscreen windows always grab the cursor).
public SetMouseCursorGrabbed ( bool grabbed ) : void
grabbed bool True to grab, false to release
Результат void

SetMouseCursorVisible() публичный Метод

Show or hide the mouse cursor
public SetMouseCursorVisible ( bool show ) : void
show bool True to show, false to hide
Результат void

SetTitle() публичный Метод

Change the title of the window
public SetTitle ( string title ) : void
title string New title
Результат void

SetVerticalSyncEnabled() публичный Метод

Enable / disable vertical synchronization
public SetVerticalSyncEnabled ( bool enable ) : void
enable bool True to enable v-sync, false to deactivate
Результат void

SetVisible() публичный Метод

Show or hide the window
public SetVisible ( bool visible ) : void
visible bool True to show the window, false to hide it
Результат void

ToString() публичный Метод

Provide a string describing the object
public ToString ( ) : string
Результат string

WaitAndDispatchEvents() публичный Метод

Wait for a new event and dispatch it to the corresponding event handler
public WaitAndDispatchEvents ( ) : void
Результат void

WaitEvent() защищенный Метод

Internal function to get the next event (blocking)
protected WaitEvent ( Event &eventToFill ) : bool
eventToFill Event Variable to fill with the raw pointer to the event structure
Результат bool

Window() публичный Метод

Create the window from an existing control with default creation settings
public Window ( IntPtr handle ) : System
handle System.IntPtr Platform-specific handle of the control
Результат System

Window() публичный Метод

Create the window from an existing control
public Window ( IntPtr Handle, ContextSettings settings ) : System
Handle System.IntPtr Platform-specific handle of the control
settings ContextSettings Creation parameters
Результат System

Window() защищенный Метод

Constructor for derived classes
protected Window ( IntPtr cPointer, int dummy ) : System
cPointer System.IntPtr Pointer to the internal object in the C API
dummy int Internal hack :)
Результат System

Window() публичный Метод

Create the window with default style and creation settings
public Window ( VideoMode mode, string title ) : System
mode VideoMode Video mode to use
title string Title of the window
Результат System

Window() публичный Метод

Create the window with default creation settings
public Window ( VideoMode mode, string title, Styles style ) : System
mode VideoMode Video mode to use
title string Title of the window
style Styles Window style (Resize | Close by default)
Результат System

Window() публичный Метод

Create the window
public Window ( VideoMode mode, string title, Styles style, ContextSettings settings ) : System
mode VideoMode Video mode to use
title string Title of the window
style Styles Window style (Resize | Close by default)
settings ContextSettings Creation parameters
Результат System