I just completed Challange 4 in the Robots sheet, which is supposed to set the font size to 48. It does not appear to be working. I tried changing the font size (even setting it to 0) and it doesn't change. See attached screenshot.
Text size does not appear to be working #18
I seem to have found the root of the issue. The size attribute of the Text class was never used! I changed the initialization of the Text class to now change size when first drawing. I decided to keep it simple and not add a "set_size" or "set_font" method because this is the beginners module. Bogging down new users with class methods seems unfair. That functionality still exists in gasp games, though. So I would direct anyone looking for a more robust Text class to use that module instead.
Now the code:
from gasp import *
begin_graphics()
run = True
while run:
# Exit on Spacebar Press
if "space" in keys_pressed():
run = False
text = Text("You can now change the text size!", (300, 300), size=48)
end_graphics()
Changes the size of the text to 48. I have demostrated this in the attached screenshots.
I think this should solve your problem, but if there is anything else I should add/change before I push to PyPI let me know.
P.S. Size 48 seems a bit large. Maybe try a smaller value and we can update the sheet later :)
Thanks, Richard! As soon as this fix is in PyPI, I'll have students:
% pip freeze > requirements.txt
% pip install -r requirements.txt --upgrade
so that they get the new version.
The changes have now been pushed to PyPI, the newest GASP version is now 0.6.2.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?