Fonts
rickierich

How do I tell wade to use the fonts I package in the fonts directory. I am going to send with the file. I am at the trial an error stage.

My logic says to set the font in the wsc file if you can as coding a solution would be a mess. How would you 

    "type": "TextSprite",
                    "text": "Connect 3 for points, 4 for EXPLODING GEMS.",
                    "name": "",
                    "font": "50px fonts/luckiest-guy-v10-latin-regular.woff",<<<<<<<<<<<<<<<<<<< Right HERE
                    "alignment": "left",
                    "color": "#b52fb5",
                    "visible": true,
                    "layer": 1,
                    "maxWidth": 0,
                    "shadowColor": "#000",
                    "shadowBlur": 0,
                    "shadowOffset": {
                        "x": 0,
                        "y": 0
                    },

 

or any other solution that I should take, still open to suggestions

All 6 Comments
Gio

Use just the main part of the file name (without the extension), in your case luckiest-guy-v10-latin-regular

But personally I would rename it to something shorter.

The important thing though, is that the font has been added to your scene assets first or this won't work. You can add it in the Scene Assets tab, under Fonts.

rickierich

This worked in wade but does not work for browsers.

Gio

You mean it works in the editor, but not in your game when you open it in a browers? Which browser(s) does it not work for?

rickierich

firefox and chrome. My intended solution is to use setfont or something like that before I load the scene. Hopefully when it is looking for the file it will take it from the cache.

Gio

It'd be helpful if you could share a simple example of it not working, if it doesn't work as it should I'd like to fix it

rickierich

Ok the problem was that wade does not load assets until it is needed. It appears anyway. 

I solved the problem with loadFont and then gave the directory name/file name. 

I did this before I loaded the scene. When it loaded the scene the font was in the cache so it was able to use it in the game.

Post a reply
Add Attachment
Submit Reply
Login to Reply