pub struct Pyxel {
pub colors: [Rgb8; 16],
pub screen: SharedImage,
pub cursor: SharedImage,
pub font: SharedImage,
/* private fields */
}
Fields
colors: [Rgb8; 16]
screen: SharedImage
cursor: SharedImage
font: SharedImage
Implementations
sourceimpl Pyxel
impl Pyxel
pub fn channel(&self, channel_no: u32) -> SharedChannel
pub fn sound(&self, sound_no: u32) -> SharedSound
pub fn music(&self, music_no: u32) -> SharedMusic
pub fn play_pos(&mut self, channel_no: u32) -> Option<(u32, u32)>
pub fn play(
&mut self,
channel_no: u32,
sequence: &[u32],
start_tick: Option<u32>,
should_loop: bool
)
pub fn play1(
&mut self,
channel_no: u32,
sound_no: u32,
start_tick: Option<u32>,
should_loop: bool
)
pub fn playm(&mut self, music_no: u32, start_tick: Option<u32>, should_loop: bool)
pub fn stop(&mut self, channel_no: u32)
pub fn stop0(&mut self)
sourceimpl Pyxel
impl Pyxel
pub fn image(&self, image_no: u32) -> SharedImage
pub fn image_no(&self, image: SharedImage) -> Option<u32>
pub fn tilemap(&self, image_no: u32) -> SharedTilemap
pub fn clip(&mut self, x: f64, y: f64, width: f64, height: f64)
pub fn clip0(&mut self)
pub fn camera(&mut self, x: f64, y: f64)
pub fn camera0(&mut self)
pub fn pal(&mut self, src_color: Color, dst_color: Color)
pub fn pal0(&mut self)
pub fn cls(&mut self, color: Color)
pub fn pget(&mut self, x: f64, y: f64) -> Color
pub fn pset(&mut self, x: f64, y: f64, color: Color)
pub fn line(&mut self, x1: f64, y1: f64, x2: f64, y2: f64, color: Color)
pub fn rect(&mut self, x: f64, y: f64, width: f64, height: f64, color: Color)
pub fn rectb(&mut self, x: f64, y: f64, width: f64, height: f64, color: Color)
pub fn circ(&mut self, x: f64, y: f64, radius: f64, color: Color)
pub fn circb(&mut self, x: f64, y: f64, radius: f64, color: Color)
pub fn elli(&mut self, x: f64, y: f64, width: f64, height: f64, color: Color)
pub fn ellib(&mut self, x: f64, y: f64, width: f64, height: f64, color: Color)
pub fn tri(
&mut self,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x3: f64,
y3: f64,
color: Color
)
pub fn trib(
&mut self,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x3: f64,
y3: f64,
color: Color
)
pub fn fill(&mut self, x: f64, y: f64, color: Color)
pub fn blt(
&mut self,
x: f64,
y: f64,
image_no: u32,
image_x: f64,
image_y: f64,
width: f64,
height: f64,
color_key: Option<Color>
)
pub fn bltm(
&mut self,
x: f64,
y: f64,
tilemap_no: u32,
tilemap_x: f64,
tilemap_y: f64,
width: f64,
height: f64,
color_key: Option<Color>
)
pub fn text(&mut self, x: f64, y: f64, string: &str, color: Color)
sourceimpl Pyxel
impl Pyxel
pub fn mouse_x(&self) -> i32
pub fn mouse_y(&self) -> i32
pub fn mouse_wheel(&self) -> i32
pub fn input_keys(&self) -> &Vec<Key>
pub fn input_text(&self) -> &str
pub fn drop_files(&self) -> &Vec<String>
pub fn btn(&self, key: Key) -> bool
pub fn btnp(
&self,
key: Key,
hold_frame_count: Option<u32>,
repeat_frame_count: Option<u32>
) -> bool
pub fn btnr(&self, key: Key) -> bool
pub fn btnv(&self, key: Key) -> KeyValue
pub fn mouse(&mut self, is_visible: bool)
pub fn set_btn(&mut self, key: Key, key_state: bool)
pub fn set_btnv(&mut self, key: Key, key_value: f64)
pub fn set_mouse_pos(&mut self, x: f64, y: f64)
sourceimpl Pyxel
impl Pyxel
pub fn ceil(&self, x: f64) -> i32
pub fn floor(&self, x: f64) -> i32
pub fn sgn(&self, x: f64) -> f64
pub fn sqrt(&self, x: f64) -> f64
pub fn sin(&self, deg: f64) -> f64
pub fn cos(&self, deg: f64) -> f64
pub fn atan2(&self, y: f64, x: f64) -> f64
pub fn rseed(&mut self, seed: u32)
pub fn rndi(&mut self, a: i32, b: i32) -> i32
pub fn rndf(&mut self, a: f64, b: f64) -> f64
pub fn nseed(&mut self, seed: u32)
pub fn noise(&self, x: f64, y: f64, z: f64) -> f64
sourceimpl Pyxel
impl Pyxel
pub fn load(
&mut self,
filename: &str,
image: bool,
tilemap: bool,
sound: bool,
music: bool
)
pub fn save(
&mut self,
filename: &str,
image: bool,
tilemap: bool,
sound: bool,
music: bool
)
pub fn screenshot(&mut self, scale: Option<u32>)
pub fn reset_capture(&mut self)
pub fn screencast(&mut self, scale: Option<u32>)
sourceimpl Pyxel
impl Pyxel
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn frame_count(&self) -> u32
pub fn title(&mut self, title: &str)
pub fn icon(&mut self, data_str: &[&str], scale: u32)
pub fn is_fullscreen(&self) -> bool
pub fn fullscreen(&mut self, is_fullscreen: bool)
pub fn run<T: PyxelCallback>(&mut self, callback: &mut T)
pub fn show(&mut self)
pub fn flip(&mut self)
pub fn quit(&mut self)
Auto Trait Implementations
impl !RefUnwindSafe for Pyxel
impl !Send for Pyxel
impl !Sync for Pyxel
impl Unpin for Pyxel
impl !UnwindSafe for Pyxel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more