자바 질문

조회수 245회

string[] friends= new string[3]; PImage img; String[] pic = { "1.png", "2.png", "3.png" };

void setup(){ size(400, 400, P3D); noFill(); img= loadImage("1.png", "2.png", "3.png"); textureMode(NORMAL); camera(width/2, height/2, (height/2) / tan(PI/6), width/2, height/2, 0, 0, 1, 0); friends = new string[3]; for ( int i=0; i<friends.length; i++) { img = loadImage( pic[ int(random(pic.length)) ] ); } }

void draw(){ background(0); translate(width / 2, height / 2); for(int i=0; i<friends.length; i++){ img = loadImage( pic[ int(random(pic.length)) ] ); friends[i] = i+1; } }

class string{ texture(img); string( ){ beginShape(QUADS); vertex(-1, -1, 1, 0, 0); vertex( 1, -1, 1, 1, 0); vertex( 1, 1, 1, 1, 1); vertex(-1, 1, 1, 0, 1); endShape();

beginShape(QUADS); vertex(-1, 1, 1, 0, 0); vertex( 1, 1, 1, 1, 0); vertex( 1, 1, -1, 1, 1); vertex(-1, 1, -1, 0, 1); endShape();

beginShape(QUADS); vertex( 1, -1, 1, 0, 0); vertex( 1, -1, -1, 1, 0); vertex( 1, 1, -1, 1, 1); vertex( 1, 1, 1, 0, 1); endShape(); } }

클래스 안에 있는 텍스쳐 부분에 밑줄이 가고 실행이 안돼요..뭐가 문제인가요..?

  • texture() 정의부가 이 글만 봐선 없는데 빨간 밑줄이라고만 하셔서 답은 아무도 모르죠. 빨간 줄이 뜨는 부분에 어떤 에러 메시지가 뜨는지도 올려보세요. 편집요청빌런 2022.6.8 09:56

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)