I'm back with my problem...I try to incorporate that in my big program, and the problem come. I simplify the code to find the problem, and I think there'se conflict with loadFont, because when I use loadFond I've a crash for 80%
I put the code.
naturaly there is no problem when I use the public void !!!
thx
- ///////////////////////
// GLOBAL SETTING ////
/////////////////////
//VIDEO
import codeanticode.gsvideo.*;
//INTERNET
import processing.net.*;
//FLUX RSS or TWITTER ????
import com.sun.syndication.feed.synd.*;
import com.sun.syndication.io.*;
//TABLET GRAPHIC
import codeanticode.protablet.*;
// for processing 2.0.b9
import java.net.*;
import java.io.*;
import java.util.*;
//to use the mouseWheel event
import java.awt.event.*;
//to make the window is resizable
java.awt.Insets insets; // use for the border of window (top and right)
//TOXIC
import toxi.geom.*;
import toxi.geom.mesh2d.*;
import toxi.util.*;
import toxi.util.datatypes.*;
import toxi.processing.*;
//METEO
import com.onformative.yahooweather.*;
//SOUND
import ddf.minim.*;
import ddf.minim.analysis.*;
///////IMPORTANT///////////////////////////////////////////////////////////////////////
//CALLING class or library in Other Class, you must call the PApplet too in your class
PApplet callingClass = this ;
//PDF save picture
import processing.pdf.*;
//LOAD IMAGE
// to drop load image
import sojamo.drop.*;
//spectrum for the color mode and more if you need
PVector HSBmode = new PVector (360,105,105) ; // give the color mode in HSB
//TYPO
PFont AmericanTypewriter ;
void setup()
{
frameRate(30) ; // Le frameRate doit être le même dans tous les Sketches
noCursor () ;
displaySetup() ;
//when I use this void without the setup with : public void that's ok, but inside the setup when I use LoadFont the problem come too much often
removeBorder() ;
//load font
//the error come from here may be...????
AmericanTypewriter=loadFont ("typo/AmericanTypewriter-96.vlw");
}
//FULLSCREEN
boolean undecorated = false ;
boolean fullScreen = false ;
boolean displaySizeByImage ;
void displaySetup()
{
colorMode(HSB, HSBmode.x, HSBmode.y, HSBmode.z, 105) ;
// load the file.txt to read your twitter code
String [] displaySetting = loadStrings ("setting/displayProperty.txt") ;
String displayS = join(displaySetting, "") ;
String [] displayInfo = split(displayS, "/") ;
//to make the window can be resizable when you open a picture
int displayX = Integer.parseInt(displayInfo[6]) ;
int displayY = Integer.parseInt(displayInfo[7]) ;
if (displayInfo[0].equals("true") || displayInfo[0].equals("TRUE")) fullScreen = true ; else fullScreen = false ;
if (displayInfo[4].equals("true") || displayInfo[0].equals("TRUE")) undecorated = true ; else undecorated = false ;
if ( fullScreen && ( displayInfo[9].equals("NOTHING") || displayInfo[9].equals("nothing") ) ) size(displayWidth, displayHeight) ;
else if ( fullScreen && displayInfo[9].equals("P2D") ) size(displayWidth, displayHeight, P2D) ;
else if ( fullScreen && displayInfo[9].equals("P3D") ) size(displayWidth, displayHeight, P3D) ;
else if ( fullScreen && displayInfo[9].equals("OPENGL") ) size(displayWidth, displayHeight, OPENGL) ;
else if ( !fullScreen && (displayInfo[9].equals("NOTHING") || displayInfo[9].equals("nothing") ) ) size(displayX, displayY) ;
else if ( !fullScreen && displayInfo[9].equals("P2D") ) size(displayX, displayY, P2D) ;
else if ( !fullScreen && displayInfo[9].equals("P3D") ) size(displayX, displayY, P3D) ;
else if ( !fullScreen && displayInfo[9].equals("OPENGL") ) size(displayX, displayY, OPENGL) ;
else size(displayWidth / 2, displayHeight / 2) ;
//resizable frame
if (displayInfo[2].equals("true") || displayInfo[2].equals("TRUE")) {
frame.pack();
insets = frame.getInsets(); // use for the border of window (top and right)
displaySizeByImage = true ;
}
}
//proble with loadFont
void removeBorder() {
frame.removeNotify();
frame.setUndecorated(undecorated);
frame.addNotify();
super.init();
}
/*
//that's ok by this way but I need to call a boolean from outside
public void removeBorder() {
frame.removeNotify();
frame.setUndecorated(undecorated);
frame.addNotify();
super.init();
}
*/
and the file.txt call by the program
- false/--fullscreen--/
false/--resizable by loading new image--/
true/--decorated the window by border or not/
1000/500/--size--/
nothing/--graphic display choice here between "NOTHING" or "P3D" or "P2D" or "OPENGL"--/