Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Attanar

I'm making a game with a scale factor of 2.

The problem I'm finding is fonts are also scaled. Since converting a font into a bitmap already adds some antialiasing, when the game is scaled, that antialiasing looks even worse.

Is there any way to avoid this problem other than using perfect pixel fonts or CSS fonts?

Thanks in advance for your help :)

1 decade ago by stillen

Do you want the fonts in the 2x scale or at the original scale?

I did something with zooming and scaling where I would override the draw and system scale on the entity, but it was very hackish. I would think you could scale the font draw back down, but you would also have to adjust the placement accordingly since they would be scaled down, or not scaled up depending on your approach.

1 decade ago by Joncom

Hmm. Allowing fonts to draw at different scales than the ig.system.scale might make for an interesting/helpful plugin... Especially in games where the game itself is drawn at one scale and the GUI scale is drawn at another scale.

EDIT:

Off the top of my head, maybe something like this could work...

ig.UnscaledFont = ig.Font.extend({

    // Overload the resize function so that the scale is always 1.
    resize: function(scale) {
        return;
    }

});

Then create your font like this instead:

var font = new ig.UnscaledFont('path/to/font.png');
Page 1 of 1
« first « previous next › last »