Page

Struct Page 

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

An event page containing most of the event state.

Each event page describes the behaviour of the event, its appearance and the scripts that it runs as a collection of Command.

Implementations§

Source§

impl Page

Source

pub fn parse(bytes: &[u8]) -> (usize, Self)

Parse raw bytes into a single Page struct.

Use of this method is highly discouraged unless you know exactly what you are doing. Prefer using Map::parse and then extract what you want from the structure tree.

§Panics

This function will panic if the given bytes do not represent a valid page structure.

This might be caused by unaligned bytes, corrupt files, incompatible format updates and library bugs. If you are confident you are doing everything right, feel free to report an issue on GitHub.

Source

pub fn icon(&self) -> &str

The filename of the icon sprite sheet used by this page.

Source

pub fn icon_mut(&mut self) -> &mut String

Mutable reference accessor for Page::icon.

Source

pub fn icon_row(&self) -> u8

The row of the selected icon in the selected sprite sheet.

Source

pub fn icon_row_mut(&mut self) -> &mut u8

Mutable reference accessor for Page::icon_row.

Source

pub fn icon_column(&self) -> u8

The column of the selected icon in the selected sprite sheet.

Source

pub fn icon_column_mut(&mut self) -> &mut u8

Mutable reference accessor for Page::icon_column.

Source

pub fn icon_opacity(&self) -> u8

The opacity the icon should have when rendered.

Source

pub fn icon_opacity_mut(&mut self) -> &mut u8

Mutable reference accessor for Page::icon_opacity.

Source

pub fn icon_blend(&self) -> &BlendType

The blend method used for painting the icon onto the background.

Source

pub fn icon_blend_mut(&mut self) -> &mut BlendType

Mutable reference accessor for Page::icon_blend.

Source

pub fn event_trigger(&self) -> &EventTrigger

The condition by which the event is triggered.

Source

pub fn event_trigger_mut(&mut self) -> &mut EventTrigger

Mutable reference accessor for Page::event_trigger.

Source

pub fn conditions(&self) -> &[Condition; 4]

The conditions that must be mut for the script to run.

Source

pub fn conditions_mut(&mut self) -> &mut [Condition; 4]

Mutable reference accessor for Page::conditions.

Source

pub fn animation_speed(&self) -> u8

The speed at which the event’s animation advance.

Source

pub fn animation_speed_mut(&mut self) -> &mut u8

Mutable reference accessor for Page::animation_speed.

Source

pub fn move_speed(&self) -> u8

The speed at which the event moves.

Source

pub fn move_speed_mut(&mut self) -> &mut u8

Mutable reference accessor for Page::move_speed.

Source

pub fn move_frequency(&self) -> u8

The frequency at which the event moves.

Source

pub fn move_frequency_mut(&mut self) -> &mut u8

Mutable reference accessor for Page::move_frequency.

Source

pub fn move_route(&self) -> &MoveRoute

How (and whether) the event should move.

Source

pub fn move_route_mut(&mut self) -> &mut MoveRoute

Mutable reference accessor for Page::move_route.

Source

pub fn options(&self) -> &Options

A set of options that influence the event rendering and behaviour.

Source

pub fn options_mut(&mut self) -> &mut Options

Mutable reference accessor for Page::options.

Source

pub fn moves(&self) -> &Vec<Move>

The pattern the event follows when moving.

This field is only valid if Page::move_route is MoveRoute::Custom, otherwise it’s empty.

Source

pub fn moves_mut(&mut self) -> &mut Vec<Move>

Mutable reference accessor for Page::moves.

Source

pub fn commands(&self) -> &Vec<Command>

The event script, in the form of a Command collection.

Source

pub fn commands_mut(&mut self) -> &mut Vec<Command>

Mutable reference accessor for Page::commands.

Source

pub fn shadow_graphic(&self) -> u8

The graphic to use for the shadow, if shadow graphics are enabled.

Source

pub fn shadow_graphic_mut(&mut self) -> &mut u8

Mutable reference accessor for Page::shadow_graphic.

Source

pub fn range_extension_x(&self) -> u8

How much the trigger area is expanded horizontally.

This field is only valid if Page::event_trigger is EventTrigger::ConfirmKey, EventTrigger::EventTouch or EventTrigger::PlayerTouch

Source

pub fn range_extension_x_mut(&mut self) -> &mut u8

Mutable reference accessor for Page::range_extension_x.

Source

pub fn range_extension_y(&self) -> u8

How much the trigger area is expanded horizontally.

This field is only valid if Page::event_trigger is EventTrigger::ConfirmKey, EventTrigger::EventTouch or EventTrigger::PlayerTouch

Source

pub fn range_extension_y_mut(&mut self) -> &mut u8

Mutable reference accessor for Page::range_extension_y.

Trait Implementations§

Source§

impl Clone for Page

Source§

fn clone(&self) -> Page

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl PartialEq for Page

Source§

fn eq(&self, other: &Page) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Page

Auto Trait Implementations§

§

impl Freeze for Page

§

impl RefUnwindSafe for Page

§

impl Send for Page

§

impl Sync for Page

§

impl Unpin for Page

§

impl UnwindSafe for Page

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.