I’m trying to load my font (Dogica Pixel) into my game. I have a .ttf file at the path shown, but whenever I start the game, it just draws the text with the Times New Roman font (default).
Here is my index.html:
`
<style media='screen' type='text/css'>
@font-face {
font-family: 'dogica';
src: url('assets/dogica/dogicapixel.ttf');
font-weight: 400;
font-weight: normal;
}
.fontPreload {
font-family: 'Tangerine';
position:absolute;
left:-100px;
}
</style>
And my game.js:
var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
scene: {
preload: preload,
create: create
}
};
var game = new Phaser.Game(config);
function preload () {}
function create () {
this.add.text(200, 100, ‘Snekrun!’, {fontFamily: ‘dogica’});
}
Any help?