class Crame::Window

Overview

A Window is where anything happening in the game will be drawn on.

When creating an instance of your Game, a window is created automatically and is used as a main window.

NOTE Currently, creating new windows alongside the main one is not supported.

Defined in:

crame/window.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(title : String, width : Int32, height : Int32) #

Instance Method Detail

def always_on_top : Bool #

Returns true if the window can be put on top of others, false otherwise.

NOTE On Wayland, this method always returns false.


def always_on_top=(always_on_top : Bool) #

Adds/Removes a flag on the window so that it can be put on top of others.

NOTE On Wayland, this method is a no-op.


def borderless : Bool #

Returns true if the window is a borderless window, false otherwise.


def borderless=(borderless : Bool) #

Adds/Removes a flag on the window to make it borderless.


def finalize #

def fullscreen : Bool #

Returns true if the window is a fullscreen window, false otherwise.


def fullscreen=(fullscreen : Bool) #

Adds/Removes a flag on the window to make it a fullscreen window.

NOTE Currently, only exclusive fullscreen is supported.


def icon=(path : String | Path) #

Adds a new icon for the window.

NOTE On Wayland, this can work only if you have support for the xdg-toplevel-icon-v1 protocol. Otherwise you'll have to create a .desktop file for the game, and affects the icon path here.


def position : Vector2 #

Returns the position of the window.


def position=(position : Vector2) #

Affects a new position for the window.

NOTE On Wayland, this method is a no-op.


def resizable : Bool #

Returns true if the window is resizable, false otherwise.


def resizable=(resizable : Bool) #

Adds/Removes a flag on the window to make it resizable.


def size : Vector2 #

Returns the size of the window.


def size=(size : Vector2) #

Affects a new size for the window.


def title : String #

Return the title of the window.


def title=(title : String) #

Sets a new title for the window.


def to_unsafe : Pointer(Void) #