← 수업 제작 도구
홈 › Components › Sketch (그림판) › 화면 17

화면 17. Sketch.disableSketch [sink]

원본: Computation Layer 문서(Sketch (그림판)) · Try It (원본 화면)

화면 번호17 / 34
문서 항목 설명 (원문)disableSketch Sets whether drawing on a sketch is permitted.

1. 화면 캡처 (빨간 번호 = 아래 표의 번호)

화면 17 캡처

2. CL이 입력된 곳

코드 안의 회색 줄은 원문 영어 주석이고, 파란 줄은 그 영어 주석의 번역이며, 연분홍 줄은 코드가 하는 일의 설명이다.

번호이름종류CL 코드 원문, 번역, 설명
1레이블 없는 그림판그림판
# This code will disable the ability to manipulate
# the sketch component after 5 strokes have been made.
▷ 이 코드는 획이 5개 그려진 뒤에는 그림판 구성요소를 조작할 수 없게 한다.

disableSketch: this.sketch.strokeCount >= 5
▶ 그림 그리기 금지(disableSketch)는 this.sketch.strokeCount >= 5, 즉 획 수가 5 이상인지 비교한 결과로 한다.
disableSketch는 그림판에 그리는 것을 허용할지를 정한다. strokeCount는 스케치를 받아 획의 수를 숫자로 돌려준다. 획이 5개가 되면 더 그릴 수 없다.