Struct Pyxel

Source
pub struct Pyxel {
Show 19 fields pub width: u32, pub height: u32, pub frame_count: u32, pub mouse_x: i32, pub mouse_y: i32, pub mouse_wheel: i32, pub input_keys: Vec<Key>, pub input_text: String, pub dropped_files: Vec<String>, pub colors: Arc<Mutex<Vec<Rgb24>>>, pub images: Arc<Mutex<Vec<SharedImage>>>, pub tilemaps: Arc<Mutex<Vec<SharedTilemap>>>, pub screen: SharedImage, pub cursor: SharedImage, pub font: SharedImage, pub channels: Arc<Mutex<Vec<SharedChannel>>>, pub tones: Arc<Mutex<Vec<SharedTone>>>, pub sounds: Arc<Mutex<Vec<SharedSound>>>, pub musics: Arc<Mutex<Vec<SharedMusic>>>, /* private fields */
}

Fields§

§width: u32§height: u32§frame_count: u32§mouse_x: i32§mouse_y: i32§mouse_wheel: i32§input_keys: Vec<Key>§input_text: String§dropped_files: Vec<String>§colors: Arc<Mutex<Vec<Rgb24>>>§images: Arc<Mutex<Vec<SharedImage>>>§tilemaps: Arc<Mutex<Vec<SharedTilemap>>>§screen: SharedImage§cursor: SharedImage§font: SharedImage§channels: Arc<Mutex<Vec<SharedChannel>>>§tones: Arc<Mutex<Vec<SharedTone>>>§sounds: Arc<Mutex<Vec<SharedSound>>>§musics: Arc<Mutex<Vec<SharedMusic>>>

Implementations§

Source§

impl Pyxel

Source

pub fn play( &self, channel_index: u32, sequence: &[u32], start_tick: Option<u32>, should_loop: bool, should_resume: bool, )

Source

pub fn play1( &self, channel_index: u32, sound_index: u32, start_tick: Option<u32>, should_loop: bool, should_resume: bool, )

Source

pub fn playm( &self, music_index: u32, start_tick: Option<u32>, should_loop: bool, )

Source

pub fn stop(&self, channel_index: u32)

Source

pub fn stop0(&self)

Source

pub fn play_pos(&self, channel_index: u32) -> Option<(u32, u32)>

Source§

impl Pyxel

Source

pub fn clip(&self, x: f64, y: f64, width: f64, height: f64)

Source

pub fn clip0(&self)

Source

pub fn camera(&self, x: f64, y: f64)

Source

pub fn camera0(&self)

Source

pub fn pal(&self, src_color: Color, dst_color: Color)

Source

pub fn pal0(&self)

Source

pub fn dither(&self, alpha: f32)

Source

pub fn cls(&self, color: Color)

Source

pub fn pget(&self, x: f64, y: f64) -> Color

Source

pub fn pset(&self, x: f64, y: f64, color: Color)

Source

pub fn line(&self, x1: f64, y1: f64, x2: f64, y2: f64, color: Color)

Source

pub fn rect(&self, x: f64, y: f64, width: f64, height: f64, color: Color)

Source

pub fn rectb(&self, x: f64, y: f64, width: f64, height: f64, color: Color)

Source

pub fn circ(&self, x: f64, y: f64, radius: f64, color: Color)

Source

pub fn circb(&self, x: f64, y: f64, radius: f64, color: Color)

Source

pub fn elli(&self, x: f64, y: f64, width: f64, height: f64, color: Color)

Source

pub fn ellib(&self, x: f64, y: f64, width: f64, height: f64, color: Color)

Source

pub fn tri( &self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, color: Color, )

Source

pub fn trib( &self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, color: Color, )

Source

pub fn fill(&self, x: f64, y: f64, color: Color)

Source

pub fn blt( &self, x: f64, y: f64, image_index: u32, image_x: f64, image_y: f64, width: f64, height: f64, color_key: Option<Color>, rotate: Option<f64>, scale: Option<f64>, )

Source

pub fn bltm( &self, x: f64, y: f64, tilemap_index: u32, tilemap_x: f64, tilemap_y: f64, width: f64, height: f64, color_key: Option<Color>, rotate: Option<f64>, scale: Option<f64>, )

Source

pub fn text( &self, x: f64, y: f64, string: &str, color: Color, font: Option<SharedFont>, )

Source§

impl Pyxel

Source

pub fn btn(&mut self, key: Key) -> bool

Source

pub fn btnp( &mut self, key: Key, hold_frame_count: Option<u32>, repeat_frame_count: Option<u32>, ) -> bool

Source

pub fn btnr(&mut self, key: Key) -> bool

Source

pub fn btnv(&mut self, key: Key) -> KeyValue

Source

pub fn mouse(&mut self, visible: bool)

Source

pub fn warp_mouse(&mut self, x: f64, y: f64)

Source§

impl Pyxel

Source

pub fn ceil(x: f64) -> i32

Source

pub fn floor(x: f64) -> i32

Source

pub fn sgn(x: f64) -> i32

Source

pub fn sqrt(x: f64) -> f64

Source

pub fn sin(deg: f64) -> f64

Source

pub fn cos(deg: f64) -> f64

Source

pub fn atan2(y: f64, x: f64) -> f64

Source

pub fn rseed(seed: u32)

Source

pub fn rndi(a: i32, b: i32) -> i32

Source

pub fn rndf(a: f64, b: f64) -> f64

Source

pub fn nseed(seed: u32)

Source

pub fn noise(x: f64, y: f64, z: f64) -> f64

Source§

impl Pyxel

Source

pub fn load_old_resource( &mut self, archive: &mut ZipArchive<File>, filename: &str, include_images: bool, include_tilemaps: bool, include_sounds: bool, include_musics: bool, )

Source§

impl Pyxel

Source

pub fn load( &mut self, filename: &str, exclude_images: Option<bool>, exclude_tilemaps: Option<bool>, exclude_sounds: Option<bool>, exclude_musics: Option<bool>, include_colors: Option<bool>, include_channels: Option<bool>, include_tones: Option<bool>, )

Source

pub fn save( &mut self, filename: &str, exclude_images: Option<bool>, exclude_tilemaps: Option<bool>, exclude_sounds: Option<bool>, exclude_musics: Option<bool>, include_colors: Option<bool>, include_channels: Option<bool>, include_tones: Option<bool>, )

Source

pub fn screenshot(&mut self, scale: Option<u32>)

Source

pub fn screencast(&mut self, scale: Option<u32>)

Source

pub fn reset_screencast(&mut self)

Source

pub fn user_data_dir(&self, vendor_name: &str, app_name: &str) -> String

Source§

impl Pyxel

Source

pub fn run<T: PyxelCallback>(&mut self, callback: T)

Source

pub fn show(&mut self)

Source

pub fn flip(&mut self)

Source

pub fn quit(&self)

Source

pub fn title(&self, title: &str)

Source

pub fn icon(&self, data_str: &[&str], scale: u32, transparent: Option<Color>)

Source

pub fn perf_monitor(&mut self, enabled: bool)

Source

pub fn integer_scale(&mut self, enabled: bool)

Source

pub fn screen_mode(&mut self, screen_mode: u32)

Source

pub fn fullscreen(&self, enabled: bool)

Auto Trait Implementations§

§

impl Freeze for Pyxel

§

impl !RefUnwindSafe for Pyxel

§

impl Send for Pyxel

§

impl Sync for Pyxel

§

impl Unpin for Pyxel

§

impl !UnwindSafe for Pyxel

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V