Skip to main content

Editor

Struct Editor 

Source
pub struct Editor {
Show 30 fields pub edit: SceneEdit, pub files: Files, pub history: History, pub viewport: Box<Viewport>, pub sources: BTreeMap<PathBuf, Source>, pub problems: Vec<Diagnostic>, pub outline: Outline, pub raw: Raw, pub rows: Vec<Row>, pub selection: Option<Item>, pub trace: bool, pub trace_samples: u32, pub play: Play, pub log: Log, pub app: String, pub pgpu: Option<String>, pub muted: bool, pub sound_available: bool, pub sound: Option<String>, pub screen: Rect, pub texture: Option<TextureId>, pub revision: u64, pub layout: Layout, pub texts: BTreeMap<String, String>, pub saves: Vec<PathBuf>, pub outside: bool, pub project: Option<Project>, pub tunables: Tunables, pub live: BTreeMap<String, Value>, pub level: Level, /* private fields */
}

Fields§

§edit: SceneEdit§files: Files§history: History§viewport: Box<Viewport>§sources: BTreeMap<PathBuf, Source>§problems: Vec<Diagnostic>§outline: Outline§raw: Raw§rows: Vec<Row>§selection: Option<Item>§trace: bool§trace_samples: u32§play: Play§log: Log§app: String§pgpu: Option<String>§muted: bool§sound_available: bool§sound: Option<String>§screen: Rect§texture: Option<TextureId>§revision: u64§layout: Layout§texts: BTreeMap<String, String>§saves: Vec<PathBuf>§outside: bool§project: Option<Project>§tunables: Tunables§live: BTreeMap<String, Value>§level: Level

Implementations§

Source§

impl Editor

Source

pub fn open(path: impl AsRef<Path>) -> Result<Editor, String>

Source

pub fn scene(&self) -> &Scene

Source

pub fn path(&self) -> &Path

Source

pub fn project_root(&self) -> &Path

Source

pub fn name(&self) -> String

Source

pub fn files(&self) -> Vec<PathBuf>

Source

pub fn refresh(&mut self)

Source

pub fn select(&mut self, item: Option<Item>)

Source

pub fn open_scene(&mut self, scene: PathBuf)

Source

pub fn set_project(&mut self, project: Project)

Source

pub fn frame_project(&mut self)

Source

pub fn selected_object(&self) -> Option<&str>

Source

pub fn editable(&self) -> bool

Source

pub fn dry(&mut self, change: &Change) -> Result<PatchGroup, String>

Source

pub fn play_edit(&mut self, session: &mut PlaySession, change: &Change) -> bool

Source

pub fn stopped(&mut self, keep: Option<&Pending>)

Source

pub fn keep(&mut self, pending: &Pending)

Source

pub fn change(&mut self, change: Change, group: Group)

Source

pub fn land(&mut self, group: PatchGroup)

Source

pub fn end_group(&mut self)

Source

pub fn grouping(&self) -> bool

Source

pub fn save(&mut self, changed: &Changed) -> bool

Source

pub fn wrote(&mut self, changed: &Changed)

Source

pub fn undo(&mut self)

Source

pub fn redo(&mut self)

Source

pub fn typed(&mut self, changed: Option<Changed>)

Source

pub fn reloaded(&mut self)

Source

pub fn events(&mut self)

Source

pub fn source(&mut self, file: &Path) -> &mut Source

Source

pub fn toggle_view(&mut self)

Source

pub fn focus(&mut self)

Source

pub fn request(&mut self, request: Request)

Source

pub fn take_requests(&mut self) -> Vec<Request>

Source

pub fn step_selection(&mut self, by: isize)

Source

pub fn play_pressed(&mut self)

Source§

impl Editor

Source

pub fn relative(&self, file: &Path) -> String

Source

pub fn layers(&self) -> Vec<Tiles>

Source

pub fn is_cell(&self, object: &str) -> bool

Source

pub fn surfaces(&mut self) -> Option<&Surfaces>

Source

pub fn lens(&self) -> Option<Lens>

Source

pub fn extent(&mut self, asset: &Path) -> Result<[[f32; 3]; 2], String>

Source

pub fn aim(&mut self, asset: &Path, at: Pos2) -> Result<Aim, String>

Source

pub fn place(&mut self, asset: &Path, at: Pos2) -> Option<String>

Source

pub fn place_at( &mut self, asset: &Path, at: [f32; 3], rotate: [f32; 3], ) -> Result<String, String>

Source

pub fn picked(&self) -> Vec<String>

Source

pub fn pick_more(&mut self, name: &str)

Source

pub fn duplicate(&mut self) -> Vec<String>

Source

pub fn align(&mut self, axis: usize, to_last: bool) -> bool

Source

pub fn distribute(&mut self, axis: usize) -> bool

Source

pub fn brush_layer(&self) -> Option<Tiles>

Source

pub fn brush_prefab(&mut self) -> Option<String>

Source

pub fn cell_under(&mut self, at: Pos2) -> Option<[i32; 2]>

Source

pub fn paint( &mut self, cells: &[[i32; 2]], erase: bool, ) -> Result<usize, String>

Source

pub fn pick_cell(&mut self, cell: [i32; 2]) -> Option<String>

Source

pub fn finish_stroke(&mut self)

Source

pub fn toggle_brush(&mut self)

Source§

impl Editor

Source

pub fn ui(&mut self, ui: &mut Ui)

Source§

impl Editor

Source

pub fn level_keys(&mut self, ctx: &Context, inside: bool)

Source

pub fn snap_gizmo(&mut self)

Source

pub fn level_viewport(&mut self, ui: &mut Ui, image: Rect)

Source

pub fn level_panel(&mut self, ui: &mut Ui) -> bool

Auto Trait Implementations§

§

impl Freeze for Editor

§

impl !RefUnwindSafe for Editor

§

impl !Send for Editor

§

impl !Sync for Editor

§

impl Unpin for Editor

§

impl UnsafeUnpin for Editor

§

impl !UnwindSafe for Editor

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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,