Found another roadblock for new and apparently dumb users like me.
I tried following the instructions here:
I got as far as needing to use python to convert the font. The python command in the console just throws this error, even after running the Windows X86-64 MSI Installer (2.7.6) [1] (sig) version from the python 2.7.6 release page, located here:
'python' is not recognized as an internal or external command, operable program or batch file.
Iām trying to use the windows Command Prompt, in the directory I downloaded the python file to. I renamed my font to match the commandās name too. I assume this is the āconsoleā I am supposed to be putting the command into? (I donāt use python much, being a windows user and all.)
Iām a bit lost now as to what to do in order to make a font for use with Play Canvas. The GitHub readme doesnāt say anything about what to do if I canāt use python, and the python installer for the version specified in the readme does not seem to install so we can use it like the readme says to.
And of course without a .json file I canāt make any text on the screen. Help?
If youāve installed Python and typing it in cmd doesnāt work itās probably an Environmental Variables issue which I think that link above explains.
āEDIT: UPDATE: Iām a bit of an idiot today. My font name is Basic.fnt, not font.fnt. The script worked right after I changed the command to:
python fnt_to_json.py Basic.fnt font.fnt
Still leaving the below part of my post, cause I am curious how one would implement the other interface mentioned, though itās probably more like another question entirely. For now Iām going to try hammering with the new json file and the font display script.
Iām not sure how to use HTML to make interface text in game. The user manual doesnāt seem to say anything on the topic (Searched for āhtml UIā, got random irrelevant stuff instead, and the part 6 tutorial that redirects back to me using these tools to make a font).
Nor do I think that will actually work for something like a clock or a speedometer, both of which need to react very quickly and dynamically turn invisible if a game isnāt in progress. I need text to show speed, current time, and also dynamic text prompts like ātap on these sides of the screen to turnā, or ālap 2 of 3ā, and such. (Iām making a racing game in case you couldnāt tell by now.)
In general itās much more powerful to use HTML / CSS for your user interface because this is the Web and you can do a lot more stuff with these technologies. The downside is that you kinda need to know how to write HTML and CSS
There is no tutorial on HTML / CSS UIās although we could write a basic one to get people started. The general way it would work is you would have an HTML asset where you would write your HTML code, a CSS asset that would contain the styling for your UI, and then a script that would create the UI using the assets above. You would use a script to get buttons etc in your HTML and attach click handlers on them or to change the displayed text of various elements.
Iām having a similar issue when trying to run the python script. I have set up my environment variables correctly, I believe, and when I try to run the script in the command line, I get the following error:
File āfnt_to_json.pyā, line 7
SyntaxError: invalid syntax
Iām not sure what to make of this error or where to go from here. Any ideas? Thanks!
I made sure to have Python 2.7.6 installed as per the instructions, so thatās not the reason. Wish it were that simple though! Iām sure it is something simple that Iām missing, but I canāt put my finger on what it is.
Whatās you operating system? And how exactly are you running the script? Can you type the exact copy from your terminal? Can you also share the entire stack trace of the error youāre getting?
Line 7 seems to be import os. Not sure why youād get an error there unless you havenāt installed Python properly.
My OS is Windows 8.1. Iām running the script through the command prompt. This is exactly how Iām running the script and the steps I used to install Python:
(1) I downloaded Python 2.7.6 and installed to the folder C:\Python27. I moved the font files that I created (fnt file and the png files) to the Python27 folder.
(2) I added the following line to my environment variables: