sf.RenderWindow Class Reference

Simple wrapper for sf.Window that allows easy 2D rendering.
Default constructor : sf.RenderWindow()
Construct a new window : sf.RenderWindow(Mode, Title, Style::Resize|Style::Close, Params = WindowSettings())
    Mode     : Video mode to use
    Title     : Title of the window
    WindowStyle     : Window style (Resize | Close by default)
    Params     : Creation parameters (see default constructor for default values)
Construct the window from an existing control : sf.RenderWindow(Handle, Params)
    Handle     : handle of the control (long integer)
    Params     : Creation parameters (see default constructor for default values)
Base class: sf.Window.

Methods

Capture()
Save the content of the window to an image. Returns a sf.Image object.
Clear(FillColor)
Clear the entire target with a single color.
    FillColor : Color to use to clear the render target.
Close()
Close (destroy) the window. The sf.Window instance remains valid and you can call Create to recreate the window.
Inherited
ConvertCoords(WindowX, WindowY, TargetView)
Convert a point in window coordinates into view coordinates. Returns a tuple of two floats.
    WindowX : X coordinate of the point to convert, relative to the window
    WindowY : Y coordinate of the point to convert, relative to the window
    TargetView : Target view to convert the point to (NULL by default -- uses the current view).
Create(Mode, Title, sf.Style.Resize | sf.Style.Close, Params = sf.WindowSettings())
Create a window.
    Mode : Video mode to use (sf.VideoMode instance)
    Title : Title of the window
    WindowStyle : Window style (Resize | Close by default)
    Params : Creation parameters (see default constructor for default values)
Inherited
Display()
Display the window on screen.
Inherited
Draw(Drawable)
Draw something on the window. The argument can be a drawable or any object supporting the iterator protocol and containing drawables (for example a tuple of drawables).
EnableKeyRepeat(Enable)
Enable or disable automatic key-repeat. Automatic key-repeat is enabled by default.
    Enabled : True to enable, false to disable
Inherited
GetDefaultView()
Get the default view of the window for read / write (returns a sf.View instance).
GetEvent(Event)
Get the event on top of events stack, if any, and pop it. Returns True if an event was returned, False if events stack was empty.
    EventReceived : Event to fill, if any.
Inherited
GetFrameTime()
Get time elapsed since last frame. Returns time elapsed, in seconds
Inherited
GetHeight()
Get the height of the rendering region of the window.
Inherited
GetInput()
Get the input manager of the window.
Inherited
GetSettings()
Get the creation settings of the window.
Inherited
GetView()
Get the current view rectangle (returns a sf.View instance).
GetWidth()
Get the width of the rendering region of the window.
Inherited
IsOpened()
Tell whether or not the window is opened (ie. has been created). Note that a hidden window (Show(False)) will still return True.
Inherited
PreserveOpenGLStates(Preserve)
Tell SFML to preserve external OpenGL states, at the expense of more CPU charge. Use this function if you don't want SFML to mess up your own OpenGL states (if any). Don't enable state preservation if not needed, as it will allow SFML to do internal optimizations and improve performances. This parameter is false by default
    Preserve : True to preserve OpenGL states, false to let SFML optimize
SetActive(Active)
Activate of deactivate the window as the current target for rendering. Returns True if operation was successful, False otherwise.
    Active : True to activate, False to deactivate (True by default)
Inherited
SetCursorPosition(Left, Top)
Change the position of the mouse cursor.
    Left : Left coordinate of the cursor, relative to the window
    Top : Top coordinate of the cursor, relative to the window
Inherited
SetFramerateLimit(Limit)
Set the framerate at a fixed frequency.
    Limit : Framerate limit, in frames per seconds (use 0 to disable limit)
Inherited
SetIcon(Width, Height, Pixels)
Change the window's icon.
    Width : Icon's width, in pixels
    Height : Icon's height, in pixels
    Pixels : Pointer to the pixels in memory, format must be RGBA 32 bits.
Inherited
SetJoystickThreshold(Threshold)
Change the joystick threshold, ie. the value below which no move event will be generated.
    Threshold : New threshold, in range [0., 100.]
Inherited
SetPosition(X, Y)
Change the position of the window on screen. Only works for top-level windows
    Left : Left position
    Top : Top position
Inherited
SetSize(Width, Height)
Change the size of the rendering region of the window.
    Width : New width
    Height : New height
Inherited
SetView(View)
Change the current active view. View must be a sf.View instance.
Show(State)
Show or hide the window.
    State : True to show, false to hide.
Inherited
ShowMouseCursor(Show)
Show or hide the mouse cursor.
    Show : True to show, false to hide.
Inherited
UseVerticalSync(Enabled)
Enable / disable vertical synchronization.
    Enabled : True to enable v-sync, False to deactivate
Inherited