Skip to Content
러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발
book

러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발

by 한선용, 이선 브라운
July 2017
Beginner to intermediate
464 pages
10h 38m
Korean
Hanbit Media, Inc.
Content preview from 러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발
45
1
첫 번째 애플리케이션
첫 번째 행에서는
Paper
.
js
를 전역 스코프에 설치했습니다(스코프에 대해서는
7
장에서 배웁
니다 ). 두 번째 행에서는
Paper
.
js
를 캔버스에 연결하고
Paper
.
js
가 그림을 그릴 수 있도록 준
비합니다. 중앙의
TODO
는 실제로 그림을 그리는 코드가 들어갈 자리입니다. 마지막 행에서는
Paper
.
js
가 실제로 화면에 그림을 그리라는 명령입니다.
이제 템플릿이 준비됐으니 그림을 그려 봅시다. 먼저 캔버스 중앙에 녹색 원을 그리겠습니다.
TODO
주석을 다음 행으로 교체하십시오.
var
c
=
Shape
.
Circle
(
200
,
200
,
50
);
c
.
fillColor
= '
green
';
브라우저를 새로고침 하니 녹색 원이 나타났습니다. 사실 이 두 행에서는 아주 많은 일을 하지
만, 지금 알아야 할 것은 몇 가지뿐입니다. 첫 번째 행은 원
객체
를 만들고, 객체를 만들기 위해
매개변수
세 가지를 받습니다. 여기서 받은 매개변수는 원 중앙의
x
,
y
좌표와 원의 반지름입
니다. 캔버스의 너비와 높이가 각각
400
픽셀이었으므로 캔버스의 중심은 (
200
,
200
)입니다.
반지름
50
픽셀은 캔버스의 너비와 높이의
8
분의
1
입니다. 두 번째 행에서는 채울 색깔 (
fill
)
정했습니다. 이 색깔은
Paper
.
js
에서
스트로크
stroke ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

웹 애플리케이션 보안: 정찰, 공격, 방어 세 단계로 배우는 웹 애플리케이션 보안의 모든 것

웹 애플리케이션 보안: 정찰, 공격, 방어 세 단계로 배우는 웹 애플리케이션 보안의 모든 것

최용, 앤드루 호프먼

Publisher Resources

ISBN: 9788968483387