Skip to main content

RaylibBuilder

Struct RaylibBuilder 

Source
pub struct RaylibBuilder { /* private fields */ }
Expand description

A builder that allows more customization of the game window shown to the user before the RaylibHandle is created.

Implementations§

Source§

impl RaylibBuilder

Source

pub fn fullscreen(&mut self) -> &mut RaylibBuilder

Sets the window to be fullscreen.

Source

pub fn log_level(&mut self, level: TraceLogLevel) -> &mut RaylibBuilder

Set the builder’s log level.

Source

pub fn resizable(&mut self) -> &mut RaylibBuilder

Sets the window to be resizable.

Source

pub fn undecorated(&mut self) -> &mut RaylibBuilder

Sets the window to be undecorated (without a border).

Source

pub fn transparent(&mut self) -> &mut RaylibBuilder

Sets the window to be transparent.

Source

pub fn msaa_4x(&mut self) -> &mut RaylibBuilder

Hints that 4x MSAA (anti-aliasing) should be enabled. The system’s graphics drivers may override this setting.

Source

pub fn vsync(&mut self) -> &mut RaylibBuilder

Hints that vertical sync (VSync) should be enabled. The system’s graphics drivers may override this setting.

Source

pub fn width(&mut self, w: i32) -> &mut RaylibBuilder

Sets the window’s width.

Source

pub fn height(&mut self, h: i32) -> &mut RaylibBuilder

Sets the window’s height.

Source

pub fn size(&mut self, w: i32, h: i32) -> &mut RaylibBuilder

Sets the window’s width and height.

Source

pub fn title(&mut self, text: &str) -> &mut RaylibBuilder

Sets the window title.

Source

pub fn build(&self) -> (RaylibHandle, RaylibThread)

Builds and initializes a Raylib window.

§Panics

Attempting to initialize Raylib more than once will result in a panic.

Trait Implementations§

Source§

impl Debug for RaylibBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for RaylibBuilder

Source§

fn default() -> RaylibBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.