IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

avec Java Discussion :

Problème de glyphs loaded


Sujet :

avec Java

  1. #1
    Membre habitué Avatar de Pecose
    Homme Profil pro
    Batiment
    Inscrit en
    Février 2013
    Messages
    310
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Batiment
    Secteur : Bâtiment

    Informations forums :
    Inscription : Février 2013
    Messages : 310
    Points : 194
    Points
    194
    Par défaut Problème de glyphs loaded
    Bonjour a tous.
    Mon code doit bien mettre 2 min a se lancer.
    Voila le fautif:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    public void initZoneText() throws SlickException{
     
    		fontTest = new UnicodeFont(new java.awt.Font("DejaVu Serif", java.awt.Font.ROMAN_BASELINE, 20));
    		fontTest.addAsciiGlyphs();
    		fontTest.addGlyphs(400,600);
    		fontTest.getEffects().add(new ColorEffect(java.awt.Color.black));
    		fontTest.loadGlyphs();
     
    		zoneText = new TextField(gc, fontTest, 30, (gc.getHeight()-gc.getHeight()/20 - etageText), (int) (gc.getWidth()-60), 30);
    		zoneText.setBackgroundColor(colorNomPerso.white.darker((float) 0.6));
    		zoneText.setText("");
    	}
    Ca me marque ce message au lencement:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    Tue Feb 11 09:21:49 CET 2014 INFO:Slick Build #264
    Tue Feb 11 09:21:49 CET 2014 INFO:LWJGL Version: 2.9.1
    Tue Feb 11 09:21:49 CET 2014 INFO:OriginalDisplayMode: 1920 x 1080 x 32 @0Hz
    Tue Feb 11 09:21:49 CET 2014 INFO:TargetDisplayMode: 1920 x 1026 x 0 @0Hz
    Tue Feb 11 09:21:49 CET 2014 INFO:Starting display 1920x1026
    Tue Feb 11 09:21:49 CET 2014 INFO:Use Java PNG Loader = true
    Tue Feb 11 09:21:49 CET 2014 INFO:Controllers not available
    Tue Feb 11 09:21:49 CET 2014 INFO:Initialising sounds..
    Tue Feb 11 09:21:49 CET 2014 INFO:- Sound works
    Tue Feb 11 09:21:49 CET 2014 INFO:- 64 OpenAL source available
    Tue Feb 11 09:21:49 CET 2014 INFO:- Sounds source generated
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    loading glyphs -1
    glyphs loaded
    Je ne comprend pas ce qui fait tout ce bazar.
    Je n'ai trouver aucune autre façon de coder ce truc puisque de toute façon une fois lancer il marche très bien.
    J'ai passer quelques heures a chercher sur d'autres forums mais j'ai rien trouver mis a part que c'est la "bonne manière de coder".
    Sauf que chez moi le programme met un temps infinis (oui 2min c'est très long) à ce lancer.
    Merci de votre aide.
    Des jours c'est facile, des jours c'est pas facile, mais c'est jamais le même jour.

  2. #2
    Membre habitué Avatar de Pecose
    Homme Profil pro
    Batiment
    Inscrit en
    Février 2013
    Messages
    310
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Batiment
    Secteur : Bâtiment

    Informations forums :
    Inscription : Février 2013
    Messages : 310
    Points : 194
    Points
    194
    Par défaut
    J'ai du neuf,
    je viens de supprimer tout le code sauf:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    zoneText = new TextField(gc, null, 30, (gc.getHeight()-gc.getHeight()/20 - etageText), (int) (gc.getWidth()-60), 30);
    J'ai remplacer fontTest par null, ce qui devrai fonctionner, mais j'ai un message d'erreur qui dit:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    java.lang.NullPointerException
    	at org.newdawn.slick.gui.TextField.render(TextField.java:250)
    	at LGP.ZoneText.renderZoneText(ZoneText.java:59)
    	at LGP.Help.render(Help.java:120)
    	at org.newdawn.slick.state.StateBasedGame.render(StateBasedGame.java:207)
    	at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:703)
    	at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:456)
    	at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:361)
    	at LGP.Main.main(Main.java:34)
    Thu Feb 13 09:19:53 CET 2014 ERROR:Game.render() failure - check the game code.
    org.newdawn.slick.SlickException: Game.render() failure - check the game code.
    	at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:706)
    	at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:456)
    	at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:361)
    	at LGP.Main.main(Main.java:34)
    AL lib: (WW) FreeDevice: (0x7f847208b400) Deleting 16 Buffer(s)
    Sachant que j'ai cette ligne dans mon render:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    zoneText.render(gc, g);
    Quelqu'un a une idée?
    Des jours c'est facile, des jours c'est pas facile, mais c'est jamais le même jour.

  3. #3
    Membre habitué Avatar de Pecose
    Homme Profil pro
    Batiment
    Inscrit en
    Février 2013
    Messages
    310
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Batiment
    Secteur : Bâtiment

    Informations forums :
    Inscription : Février 2013
    Messages : 310
    Points : 194
    Points
    194
    Par défaut
    Trouver! En fait j'ai deux init imbriqués l'un dans l'autre pour épurer et gagner en lisibilité:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    public void init(GameContainer gcx, StateBasedGame sbgx) throws SlickException {
    // voila ou se trouve fontTest maintenant
    zoneText[x].initZoneText();
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    public void initZoneText() throws SlickException{
    		// ici se trouvait fontTest
    		zoneText = new TextField(gc, fontTest, 30, (gc.getHeight()-gc.getHeight()/20 - etageText), (gc.getWidth()-60), 30);
    		zoneText.setBackgroundColor(colorNomPerso.white.darker((float) 0.6));
    		zoneText.setText("");
    	}
    J'ai juste modifier l'emplacement de la déclaration et c'est bon.
    Des jours c'est facile, des jours c'est pas facile, mais c'est jamais le même jour.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [JTree] Problème de lazy load
    Par heid dans le forum Composants
    Réponses: 4
    Dernier message: 07/09/2007, 11h15
  2. Problème de lazy load
    Par breezer911 dans le forum Hibernate
    Réponses: 1
    Dernier message: 13/08/2007, 15h11
  3. Problème unable to load x.dll
    Par Ice-tea dans le forum Delphi
    Réponses: 3
    Dernier message: 20/09/2006, 14h52
  4. [ASE 12.5.1] problème avec un load
    Par Bart1 dans le forum Adaptive Server Enterprise
    Réponses: 2
    Dernier message: 12/07/2006, 16h46
  5. [FLASH 8] [XML] Problème avec XML.load() asynchrone
    Par SSJ17Vegeta dans le forum Flash
    Réponses: 1
    Dernier message: 20/01/2006, 18h47

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo