I have an array of points whose coordinates are the segments of a circumference (aka, points like in a clock)
I want to draw numbers (again, like in a clock) in those points. But they are not being drawn, so I changed the code to just:
var font = global.font;
draw_string(font, Vector2(320, 240), "Hug you", Color(1.0, 1.0, 0.0, 1.0));
So global.font is just the font of a label, that font I have stored it in a script called global
So, draw a string witha default font, position (320, 240), a string, a color with an alpha and done
Also sorry for the cursewords (censored it to "Hug you"), this thing I just wanted to do it to get a screenshot and use it in a monography I'm writing. I just #ed all the rest of the code and wrote those lines, but as it didn't work I just got progresively angrier cause I've been trying to draw just three bloody characters for idk, a too long time for such a simple task. So, sorry for being angry. I am angry with myself, so that curseword is written for me.
Also all this code is in the _draw function of a canvasitem node.
I once managed to get those numbers drawn but they were behind the circle, so I just moved those two lines, and Bam!, no characters being drawn anymore.
I am sure I am making a very silly mistake, and I just need to add a litle something, but I just don't know what I have to change.
Okay then, so what should my code look like in order for it to draw "I love you" in the position (320, 240)?
Thank you in advance!
Edit: In terminal "ERROR CanvasItem::drawstring: condition ' pfont.isnull<> ' is true.
I get the problem has to do with the font, but I don't know the exact meaning of that error.
How can I set a default font? I tried getting the font directly from the label using getnode("path").getfont but I couldn't find the path to that label.
I tried using first the name of the label, then "res://Content/....path of the scene/main.tscn/name of the label" but it didn't work so that's why I tried storing the font in the global script, using global.font = self.get_font inside the label. Idk what else to do. I'll keep trying.