Maybe I’m missing something, but I can’t seem to figure out how to REMOVE a custom font from a Text object without deleting and recreating the object. I’ve tried erasing the font name, but doing so generates the error message: “that resource does not exist in the game”. Any ideas?
Sorry, never mind. I tried both of the things I was going to suggest, but they didn’t work.
Would you like the police to be the basic font ?
I have something like this for you.
I need to made a extension file, i’ve not time for moment but i will come back with it.
Durging this time read about how to import extension on wiki.
Thanks, @Bouh, but what I really wanted to do was remove a font assigned in the GDevelop Editor, not remove it on the fly during the game.
I have a feeling that this may be an “unexpected behavior” of an over aggressive error check for the Font field in a Text object. The field should handle the removal of a custom font (allowing the GDevelop default font to reactivate), but should also remove the font inclusion code:
if there are no other references to the font.
Oh, maybe if you delete the font in ressources, or your can recreate a object it’s simple to do.
I located and removed the font via the resources, however the Text object still shows the font (and the text is displayed in the font). I suspect that this will cause issues when I export the project since the associated font is not included in the package.
I would rather not delete the text objects, since they are linked to actions which would need to be recreated, so I’m going to restore a prior version of the .jason file and try another approach.
Maybe @4ian can look into why the error message is triggering on a null value and schedule a fix. Since the font resource can be removed independently (via Resources) there is no need to check for and remove the resource automatically.
I have that issue with deleting objects too.
If you want to keep the events safe, try copying them into a function, even if it’s only temporary as a kind of holder. They won’t be deleted there.
Another way is to rename the old text object, create your new one, and then do a search and replace in your events to change the name to the new object. Once you have the new name in the events, you can safely delete the old object.