JujuAdams / Scribble

Efficient, internationalized, multi-effects text renderer for GameMaker
https://www.jujuadams.com/Scribble/
MIT License
335 stars 46 forks source link

Can't get scribble method to recognize spritefont #541

Closed AMZYoshio closed 3 months ago

AMZYoshio commented 3 months ago

I apologize in advance if this is an obvious question, but I have been scouring the documentation and google for the entire last day and for the life of me I cannot figure this out.

I have a project that I'd love to implement Scribble into, and I for the life of me cannot get the scribble() method to recognize a spritefont that is added at runtime. When trying to reference the font in the method, it throws a hard error and crashes.

Scribble1

I set up 3 font check debug messages to try and get it to detect, but they all return 0 (not recognized), despite using this and other assorted fonts throughout the game already. The above code is on the create event of a controller object that is the first object spawned before any other game logic is run.

Scribble2

Please tell me I missed something very simple because I absolutely love the potential of Scribble and would be overjoyed to be able to implement it. I do realize that fonts added using font_add() are not supported, but I thought spritefonts were okay. Is the solution that I have to include a .ttf font file and cannot use font_add_sprite() or font_add_sprite_ext() at all? It seems scribble_font_add_front_sprite() looks to be deprecated as well.

Game Maker IDE: v2024.4.1.152 Runtime: v2024.4.1.201

JujuAdams commented 3 months ago

You should use the name of the sprite ("fontspritewhite") not the name of the variable that holds the sprite.

Edit: Also I notice you're using Scribble 8. If you're on a newer version of GameMaker you should use Scribble 9 (little has changed but it puts you in a better position for support down the road).