Struct LvdFile

Source
pub struct LvdFile {
Show 23 fields pub collisions: Section<Collision>, pub spawns: Section<Spawn>, pub respawns: Section<Spawn>, pub camera_boundary: Section<Bounds>, pub blast_zone: Section<Bounds>, pub enemy_generators: UnsupportedSection, pub unk1: UnsupportedSection, pub unk2: UnsupportedSection, pub unk3: UnsupportedSection, pub fs_area_cam: UnsupportedSection, pub fs_cam_limit: UnsupportedSection, pub damage_shapes: Section<DamageShape>, pub item_spawners: Section<ItemSpawner>, pub ptrainer_ranges: Section<PokemonTrainerRange>, pub ptrainer_platforms: Section<PokemonTrainerPlatform>, pub general_shapes: Section<GeneralShape>, pub general_points: Section<Point>, pub unk4: UnsupportedSection, pub unk5: UnsupportedSection, pub unk6: UnsupportedSection, pub unk7: UnsupportedSection, pub shrunken_camera_boundary: Section<Bounds>, pub shrunken_blast_zone: Section<Bounds>,
}
Expand description

The top-level structure representing the LVD file containing all the sections included within it.

let file = lvd::open("./pickel_world_00.lvd").unwrap();

println!("{:?}", &file.collisions[0].vertices[0]);

file.save("./pickel_world_00_edited.lvd").unwrap();

Fields§

§collisions: Section<Collision>

Collisions for the various platforms of the stage.

These can have arbitrary 2d shapes with ledges, various types of collisions, different properties, etc. See Collision for more info.

§spawns: Section<Spawn>

The initial spawnpoints of characters when starting the match

§respawns: Section<Spawn>

The points in space where respawn platforms arrive

§camera_boundary: Section<Bounds>

The furthest edges of the stage that the camera can pan to

§blast_zone: Section<Bounds>

The bounds of how far fighters can go before they die from the blast zones

§enemy_generators: UnsupportedSection

Locations where enemies can be spawned

§unk1: UnsupportedSection§unk2: UnsupportedSection§unk3: UnsupportedSection§fs_area_cam: UnsupportedSection

Points where the final smash area camera is placed

§fs_cam_limit: UnsupportedSection

Limit to panning of the final smash camera

§damage_shapes: Section<DamageShape>

Places in the stage with hurtboxes attackable by players

§item_spawners: Section<ItemSpawner>

Areas of the stage in which items can spawn

§ptrainer_ranges: Section<PokemonTrainerRange>

Areas within the stage that pokemon trainers can move around on

§ptrainer_platforms: Section<PokemonTrainerPlatform>

Platforms where pokemon trainers hover

§general_shapes: Section<GeneralShape>

Generic shapes describing features of the stage

§general_points: Section<Point>

Generic points describing locations on the stage (used for final smash locations like Ike’s, for example)

§unk4: UnsupportedSection§unk5: UnsupportedSection§unk6: UnsupportedSection§unk7: UnsupportedSection§shrunken_camera_boundary: Section<Bounds>

Camera boundary but after it has shrunken for sudden death

§shrunken_blast_zone: Section<Bounds>

Blast zone boundary but after it has shrunken for sudden death

Implementations§

Source§

impl LvdFile

Source

pub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>

Source

pub fn write<W: Write + Seek>(&self, writer: &mut W) -> Result<(), Error>

Source§

impl LvdFile

Source

pub fn open<P: AsRef<Path>>(path: P) -> BinResult<Self>

Read and parse an LVD from a file at a given path

use lvd::LvdFile;

let file = LvdFile::open("path/to/file.lvd").unwrap();

Trait Implementations§

Source§

impl BinRead for LvdFile

Source§

type Args = ()

The type used for the args parameter of read_args() and read_options(). Read more
Source§

fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_options: &ReadOptions, __binrw_generated_var_arguments: Self::Args, ) -> BinResult<Self>

Read Self from the reader using the given ReadOptions and arguments.
Source§

fn read<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args: Default,

Read Self from the reader using default arguments.
Source§

fn read_args<R>(reader: &mut R, args: Self::Args) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader using the given arguments.
Source§

fn after_parse<R>( &mut self, _: &mut R, _: &ReadOptions, _: Self::Args, ) -> Result<(), Error>
where R: Read + Seek,

Runs any post-processing steps required to finalize construction of the object.
Source§

impl Debug for LvdFile

Source§

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

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

impl HasMagic for LvdFile

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.