Function rusty_spine::extension::set_create_texture_cb
source · Expand description
Set _spAtlasPage_createTexture
The purpose of this callback is to allow loading textures in whichever engine is being used. The following example shows the intended usage by storing the texture on the renderer object of the AtlasPage which can be acquired later.
struct SpineTexture(pub String);
rusty_spine::extension::set_create_texture_cb(|atlas_page, path| {
atlas_page.renderer_object().set(SpineTexture(path.to_owned()));
});
rusty_spine::extension::set_dispose_texture_cb(|atlas_page| unsafe {
atlas_page.renderer_object().dispose::<SpineTexture>();
});