Processing text shifting issue

Hi i have issue with text() command


here is a sorce code

//Ascii Video Player
String[] video;
int heig,widt;
int d;
int textSizes=7;
void setup(){
size(800,600);
video = loadStrings(“sss.txt”);
frameRate(30);
String[] s = split(video[0],’,’);
d=0;
heig=int(s[1]);
widt=int(s[0]);
// println(“Playing audio”);
.// println(“audio is started”);
textSize(textSizes);
//textAlign(CENTER);
}
void draw(){
background(255);
fill(0);
drawScreen();
//d+=1;
}
void keyPressed(){
println(d);
if(key == ’ '){
d=287;
}
}
void drawScreen(){
try{
for(int i=0;i<heig;i++){
text(video[dheig+i],20,itextSizes);
}
}catch(ArrayIndexOutOfBoundsException e){
d=0;
}
}

I looked into sss.txt file and it looks in there just fine.

Welcome to the forum! Could you please describe what issue you are having exactly?

Also please show us the contents of sss.txt.

i already shown

Ah, okay. Still, what is the error you are facing?

Maybe i should show more pictures to describe the issue

Perhaps you should explain in words rather than relying on members making the correct assumptions from the pictures.

1 Like

The main issue is that the text keeps shiffting to the right, but in the file there isn’t any spaces or aditional characters.

So you are reading the text from a file, and when you’re trying to display it in Processing it is shifted to the right?

yes, that’s exactly what i was talking about.

Then you need to give as the contents of sss.txt as text, not an image because without that your code just straight up crashes.

https://gebreee.000webhostapp.com/sss.txt

I’m not going to give a whole file because it’s like 160 megs.

For some reason it shifts there to.

That’s probably because there actually are spaces in the file. How else would it be indented in the file directly?

o i mean it’s because of my browser window. I think

There are actual spaces before every line in the text file.

Take a look in the file as a source code.

What do you mean by as source code? Just in regular text-editor? Because I’ve done that.

like that

before url add view-source:

I’m sorry, but I don’t think I can help you.