Jump to content

it's late but text isn't showing up


obliviot
 Share

Recommended Posts

I am using the font.fnt asset which is used on some of the tutorials. My text just isnt showing up on screen

game.addAsset('font.fnt');


game.createScene('Main', {
    backgroundColor: '#000000',
    word_score: 0,
    total_score: 0,
    picked_word: '',

    init: function() {
        this.bg = new game.TilingSprite('play-bg.png');
        this.bg.addTo(this.stage);
        
        this.board = new game.Board(game.width / 2, game.height / 2 - 50);
        this.board.container.addTo(this.stage);
        
        var text = new game.Text('Hello Panda');
        text.addTo(this.stage);
        
    }
});

 

I have tried removing the tiling sprite and bard class from the init but still no joy. Anything i should be looking for?

Link to comment
Share on other sites

  • 1 month later...

Hi, I have a similar issue:

game.addAsset('font.fnt');

game.createScene('Main', {
    backgroundColor: '#00CCFF',
    init: function() {
            var info = new game.Text('Informations');
            info.addTo(this.stage);
            
            var text = new game.SystemText('System text...');
            text.addTo(this.stage);
        }
});

I tried with different types of *.fnt (xml, txt formats), same result. Text not rendering. I attached media folder & main screen capture.

Thanks for help,

Claudiu.

fonts.PNG

main_stage.PNG

Edited by Claudiu Macovei
I replaced the font with ones used in the demos[endlessrunner] and it works...
Link to comment
Share on other sites

@enpu I did it -> version 2.7.0.

I'm getting:

Uncaught TypeError: Cannot read property 'replace' of undefined
    at Class.parseFont (loader.js:342)
    at Class.<anonymous> (core.js:932)
    at XMLHttpRequest.<anonymous> (core.js:932)
 font[name][cont[0]] = cont[1].replace(/['"]+/g, '');

Thanks

Link to comment
Share on other sites

@enpu

Yes, all good on 2.7.1dev branch, thanks. ?

I have another issue, editor related. I ran the game in detached window mode, with a fullscreen option in the game. The screen had been maximized by calling of game.system.fullscreen(), but now I cannot resize it back as is in attached mode. Same for the editor window. Maybe I missing something. Reinstalled on same PC, same issue. Installed on new PC - okay. Some caches save this fullscreen preferences.

 

Capture.PNG

Edited by Claudiu Macovei
no min max button for window (cannot disable the fullscreen mode)
Link to comment
Share on other sites

@enpu

Yes. It looks like the maximize/minimize buttons form disappeared. The gray bar from the last capture is from panda editor. Should contains the 3 buttons (min/max/exit). That disappeared when I called the game.system.fullscreen(). If the live form is detached will be always on fullscreen mode, if the live panel is reattached back this is shown in his place, but the whole editor is in a full screen mode. My supposition is that the editor should contains some option to exit from fullscreen, like Window -> Minimize/Zoom. My OS taskbar is hidden only when Panda editor is selected/on view.

Capture.PNG

 

detached.PNG

Edited by Claudiu Macovei
valid windows - this is on another machine
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...