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

화면 10. Sketch.currentY [source]

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

화면 번호10 / 34
문서 항목 설명 (원문)currentY Gets the current y-coordinate of the mouse. Works on hover with a mouse and while depressed for touch.

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

화면 10 캡처

2. CL이 입력된 곳

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

번호이름종류CL 코드 원문, 번역, 설명
1master CL
(화면 전체)
SCREEN
# Use a subtitle sink to display the current 
# y-coordinate of the cursor on the sketch component.
# A ${ } is used to put the number into a string.
▷ 부제목 sink로 그림판 구성요소에서 커서의 현재 y좌표를 표시한다. 숫자를 글자에 넣을 때 ${ }를 쓴다.

subtitle: "Current `y`: `${sampleSketch.currentY}`"
▶ 화면 제목 아래에 표시할 부제목(subtitle)은 "Current `y`: `${sampleSketch.currentY}`"(현재 y: 뒤에 커서의 y좌표)로 한다.
글자 안에서 백틱(`)으로 감싼 부분은 latex 값이다. currentY는 마우스의 현재 y좌표를 알려 주며, 마우스는 올려만 두어도, 터치는 누르고 있는 동안 작동한다. ${ }는 글자 안에 변수의 값을 끼워 넣는 표기이다. subtitle은 화면 제목 아래 가운데에 부제목을 붙인다.