anna
May 12, 2019, 11:36am
1
My text in this button looks very poorly.
But when I click another button on the screen, it looks normal!
Here is my code:
void draw (){
if (mode== INTRO){ // introskærm
doIntroMode();
}
else if (mode==KASSE){ // kassespil
doKasseMode();
}
else if (mode ==BUTIK){ // i butikken
doButikMode();
}
else if (mode ==STUDY){ // læse op
doStudyMode();
}
fill(0);
textSize(200);
text("=", 123,130 );
}
1 Like
quark
May 12, 2019, 11:38am
2
Can’t see any text in either picture.
anna
May 12, 2019, 11:48am
3
my text is the “=” figure
Text looks better when using createFont in setup() with textFont(…
Also try textMode(SHAPE);
versus
textMode(MODEL);
it’s also different if you are in 2D or 3D
anna
May 12, 2019, 12:52pm
5
I don’t quite understand. I have downloaded a font
PFont font;
void setup() {
size(1250,800);
font = loadFont("skrift.vlw");
textFont(font);
}
void draw (){
fill(0);
textAlign(CENTER);
textSize(200);
text("=", 123,130 );
}
Where do you reckon I insert “createFont”?
quark
May 12, 2019, 3:01pm
6
You obviously created the font file skrift.vlw
through Processing - what font size did you use because you are displaying it at very large size (200)
1 Like
I just wanted to make sure you have it. createFont is as good as loadFont
1 Like
this looks good on my computer
PFont font;
void setup() {
size(1250, 800);
font = createFont("skrift.vlw", 200);
textFont(font);
smooth();
}
void draw () {
background(255);
fill(0);
textAlign(CENTER);
textSize(200);
text("=", 123, 130 );
}
I believe the issue is because you are not calling background(255)
as your first line in draw()
. This is explained in the reference here :
It is common to call background() near the beginning of the draw() loop to clear the contents of the window, as shown in the first example above. Since pixels drawn to the window are cumulative, omitting background() may result in unintended results.
Kf
3 Likes