module SF

Extended Modules

Defined in:

audio/audio.cr
audio/obj.cr
common.cr
graphics/graphics.cr:1
graphics/graphics.cr:135
graphics/obj.cr
network/network.cr
network/obj.cr
system/obj.cr
system/system.cr
version.cr
window/obj.cr
window/window.cr:3
window/window.cr:10

Constant Summary

SFML_VERSION = "2.5.1"
VERSION = "2.5.3"

Instance Method Summary

Instance Method Detail

def color(*args, **kwargs) #

Shorthand for Color.new


[View source]
def float_rect(left : Number, top : Number, width : Number, height : Number) #

Shorthand for FloatRect.new

Converts arguments to Float32


[View source]
def int_rect(left : Int, top : Int, width : Int, height : Int) #

Shorthand for IntRect.new

Converts arguments to Int32


[View source]
def microseconds(amount : Int) : Time #

Construct a time value from a number of microseconds

  • amount - Number of microseconds

Returns: Time value constructed from the amount of microseconds

See also: #seconds, #milliseconds


[View source]
def milliseconds(amount : Int) : Time #

Construct a time value from a number of milliseconds

  • amount - Number of milliseconds

Returns: Time value constructed from the amount of milliseconds

See also: #seconds, #microseconds


[View source]
def seconds(amount : Number) : Time #

Construct a time value from a number of seconds

  • amount - Number of seconds

Returns: Time value constructed from the amount of seconds

See also: #milliseconds, #microseconds


[View source]
def sleep(duration : Time) #

Make the current thread sleep for a given duration

SF.sleep is the best way to block a program or one of its threads, as it doesn't consume any CPU power.

  • duration - Time to sleep

[View source]
def vector2(x, y) #

Shorthand for Vector2.new

If arguments are mixed between Int32 and Float, they are converted to match Vector2f


[View source]
def vector2f(x : Number, y : Number) #

Shorthand for Vector2f.new

Converts arguments to Float32


[View source]
def vector2i(x : Int, y : Int) #

Shorthand for Vector2i.new

Converts arguments to Int32


[View source]
def vector2u(x : Int, y : Int) #

Shorthand for Vector2u.new

Converts arguments to UInt32


[View source]
def vector3(x, y, z) #

Shorthand for Vector3.new


[View source]
def vector3f(x : Number, y : Number, z : Number) #

Shorthand for Vector3f.new

Converts arguments to Float32


[View source]