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

화면 8. Sketch.currrentStroke [source]

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

화면 번호8 / 34
문서 항목 설명 (원문)currentStroke Gets a sketch object that represents the current stroke in progress.

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

화면 8 캡처

2. CL이 입력된 곳

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

번호이름종류CL 코드 원문, 번역, 설명
1레이블 없는 메모메모
content:
	# Ask the student to sketch something and change the note to "sketching..."
    # while they are actively sketching.
▷ 학생에게 스케치를 하라고 요청하고, 스케치하는 동안에는 메모를 "sketching..."으로 바꾼다.
  when sampleSketch.currentStroke.totalStrokeLength = 0 "Sketch something."
  otherwise "sketching..."
▶ 메모의 내용(content)은 sampleSketch.currentStroke.totalStrokeLength가 0이면 "Sketch something."(무언가 스케치하시오.), 그렇지 않으면 "sketching..."(스케치하는 중...)으로 한다.
currentStroke는 지금 그리는 중인 획을 나타내는 스케치를 가져오고, totalStrokeLength는 스케치를 받아 모든 획의 길이를 합친 숫자를 돌려준다. when은 조건을 차례로 확인해 처음 맞는 값을 쓴다. content는 메모에 직접 적은 글을 덮어쓴다.