8bitdna

SystemText Class Bug?

Recommended Posts

Hi @enpu

I'm using the SystemText class to speed up some dev and came across a bug I think when I'm using the 'hires' feature of the engine.  In my game config I have...

game.config = {
    name: 'Slide',

    system: {
        width: 640,
        height: 960,
        scale: true,
        center: true,
        resize: false,
        hidpi: true,
        hires: 4
    },
    
    scene: {
        backgroundColor: '#ffffff'
    },

    mobile: {
        system: {
            resize: true
        }

    }
};

...so 'hires' is set to four.  When I test on my phone its fine, hires scale is 1 which I can see in the debug panel, everything looks fine.  I test on my iPad and the hires scale ups to 2, which is great, sprites look good still BUT font size of the SystemText jumps a size.  So I had a little dig in the engine sourcecode (I'm using 2.7.1dev) in the '/engine/renderer/text.js' file I see this line in the SystemText class (line 483):

context.font = this.size * game.scale * game.scale + 'px ' + this.font;

...I changed it to...

context.font = this.size * game.scale + 'px ' + this.font;

...and it seems to render better (removed the duplicate scaling).  If you could confirm this is ok please and if so roll into the GitHub engine that would be great please.  I really need to learn how to perform pull requests lol

Share this post


Link to post
Share on other sites

Awesome, when I get some time I'll put some effort into learning some Git basics.  I'd like to help with the engine side of things where I can and understand it more also.

Quick question in fact regarding the 'Text' class please and asset management when I get a little further forward.  I see I can load *.fnt files, whats the preferred software to produce these files (and the matching atlas bitmaps of the font) please?  I know in theory any software that handles the format should be ok but for now I'd like to keep with the 'path of least resistance' and go what you know is working great.

Thanks as always.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.