Open randomPoison opened 6 years ago
#[serde(skip)]
I don't think UiText will be deserializable any time soon though, as it requires the runtime handles.
What is deserializable though is the UiText prefab :D
Ah, looks like UiText
also has a non-private field font
that is a FontHandle
, so it's not going to be enough to simply skip the private fields. Looks like it's going to need to wait for #7.
You can skip the font handle for the serialization though
amethyst/amethyst#1003 adds serialization support for a number of new components and resources. These should be added to the list of default types (being added in #21) once Amethyst 0.9 is released.
Originally brought up by @jojolepro in randomPoison/amethyst-editor#29.
The following components provided by Amethyst do not implement
Serialize
:UiTransform
MeshData
UiText
Removal<T>
UiButton
FlyControlTag
Parent
And the following resources provided by Amethyst do not implement
Serialize
:HideCursor
I'm making a PR to Amethyst adding missing
Serialize
impls to any types that only contain simple data. The following types are more complex and will need special handling:MeshData
contains potentially large amounts of data, and therefor should not be serialized and sent every frame for performance purposes. I'm also not clear what exactlyMeshData
is used for? I'm more familiar with usingMeshHandle
for attaching meshes to entities. IsMeshData
used for dynamically-generated meshes? We'll have to discuss it in more detail to determine how it should be handled, both in terms of serialization and how we should display it in the editor.UiText
contains a good chunk of plain data that could be shown directly in the editor, but it also contains some private data that can't be (or at least shouldn't be) serialized (specifically the cached font handle, cached glyphs, and cached brush ID). There are potentially a few ways to solve this:Serialize
and have it only serialize the data we care about. This is okay for now, but we do eventually want to be able to modify this data in the editor, which will require aDeserialize
impl.~UiTextCache
component.~Parent
contains anEntity
, which means it cannot be serialized directly. It is going to need #7 to be implemented in order to properly support serialization ofEntity
values.