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
impl Pyxel
pub fn play( &self, channel_index: u32, sequence: &[u32], start_tick: Option<u32>, should_loop: bool, should_resume: bool, )
pub fn play1( &self, channel_index: u32, sound_index: u32, start_tick: Option<u32>, should_loop: bool, should_resume: bool, )
pub fn playm( &self, music_index: u32, start_tick: Option<u32>, should_loop: bool, )
pub fn stop(&self, channel_index: u32)
pub fn stop0(&self)
pub fn play_pos(&self, channel_index: u32) -> Option<(u32, u32)>
Source§impl Pyxel
impl Pyxel
pub fn clip(&self, x: f64, y: f64, width: f64, height: f64)
pub fn clip0(&self)
pub fn camera(&self, x: f64, y: f64)
pub fn camera0(&self)
pub fn pal(&self, src_color: Color, dst_color: Color)
pub fn pal0(&self)
pub fn dither(&self, alpha: f32)
pub fn cls(&self, color: Color)
pub fn pget(&self, x: f64, y: f64) -> Color
pub fn pset(&self, x: f64, y: f64, color: Color)
pub fn line(&self, x1: f64, y1: f64, x2: f64, y2: f64, color: Color)
pub fn rect(&self, x: f64, y: f64, width: f64, height: f64, color: Color)
pub fn rectb(&self, x: f64, y: f64, width: f64, height: f64, color: Color)
pub fn circ(&self, x: f64, y: f64, radius: f64, color: Color)
pub fn circb(&self, x: f64, y: f64, radius: f64, color: Color)
pub fn elli(&self, x: f64, y: f64, width: f64, height: f64, color: Color)
pub fn ellib(&self, x: f64, y: f64, width: f64, height: f64, color: Color)
pub fn tri( &self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, color: Color, )
pub fn trib( &self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, color: Color, )
pub fn fill(&self, x: f64, y: f64, color: Color)
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>, )
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>, )
pub fn text( &self, x: f64, y: f64, string: &str, color: Color, font: Option<SharedFont>, )
Source§impl Pyxel
impl Pyxel
pub fn btn(&mut self, key: Key) -> bool
pub fn btnp( &mut self, key: Key, hold_frame_count: Option<u32>, repeat_frame_count: Option<u32>, ) -> bool
pub fn btnr(&mut self, key: Key) -> bool
pub fn btnv(&mut self, key: Key) -> KeyValue
pub fn mouse(&mut self, visible: bool)
pub fn warp_mouse(&mut self, x: f64, y: f64)
Source§impl Pyxel
impl Pyxel
pub fn ceil(x: f64) -> i32
pub fn floor(x: f64) -> i32
pub fn sgn(x: f64) -> i32
pub fn sqrt(x: f64) -> f64
pub fn sin(deg: f64) -> f64
pub fn cos(deg: f64) -> f64
pub fn atan2(y: f64, x: f64) -> f64
pub fn rseed(seed: u32)
pub fn rndi(a: i32, b: i32) -> i32
pub fn rndf(a: f64, b: f64) -> f64
pub fn nseed(seed: u32)
pub fn noise(x: f64, y: f64, z: f64) -> f64
Source§impl Pyxel
impl Pyxel
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
impl Pyxel
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>, )
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>, )
pub fn screenshot(&mut self, scale: Option<u32>)
pub fn screencast(&mut self, scale: Option<u32>)
pub fn reset_screencast(&mut self)
pub fn user_data_dir(&self, vendor_name: &str, app_name: &str) -> String
Source§impl Pyxel
impl Pyxel
pub fn run<T: PyxelCallback>(&mut self, callback: T)
pub fn show(&mut self)
pub fn flip(&mut self)
pub fn quit(&self)
pub fn title(&self, title: &str)
pub fn icon(&self, data_str: &[&str], scale: u32, transparent: Option<Color>)
pub fn perf_monitor(&mut self, enabled: bool)
pub fn integer_scale(&mut self, enabled: bool)
pub fn screen_mode(&mut self, screen_mode: u32)
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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