Instance Methodmigueldeicaza.swiftgodot 0.45.0SwiftGodot
clear
Clears the library.
MeshLibrary.swift:699final func clear()
Other members in extension
Type members
Instance members
func createItem(id: Int32
) Creates a new item in the library with the given ID.
func findItemByName(String
) -> Int32 Returns the first item with the given name.
func getItemList(
) -> PackedInt32Array Returns the list of item IDs in use.
func getItemMesh(id: Int32
) -> Mesh? Returns the item’s mesh.
func getItemMeshTransform(id: Int32
) -> Transform3D Returns the transform applied to the item’s mesh.
func getItemName(id: Int32
) -> String Returns the item’s name.
func getItemPreview(id: Int32
) -> Texture2D? When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using
setItemPreview(id:texture:)
. Returns an emptyTexture2D
if no preview was manually set in a running project.func getItemShapes(id: Int32
) -> GArray Returns an item’s collision shapes.
func getLastUnusedItemId(
) -> Int32 Gets an unused ID for a new item.
func removeItem(id: Int32
) Removes the item.
func setItemMesh(id: Int32, mesh: Mesh?
) Sets the item’s mesh.
func setItemMeshTransform(id: Int32, meshTransform: Transform3D
) Sets the transform to apply to the item’s mesh.
func setItemName(id: Int32, name: String
) Sets the item’s name.
func setItemPreview(id: Int32, texture: Texture2D?
) Sets a texture to use as the item’s preview icon in the editor.
func setItemShapes(id: Int32, shapes: GArray
) Sets an item’s collision shapes.