Skip to content

TextBox in Canvas

juhyojeong edited this page Dec 4, 2022 · 1 revision

FabricJS๋ฅผ ์“ฐ๋ฉด์„œ ํ•œ ๊ฐ€์ง€ ๋ฌธ์ œ์— ์ง๋ฉดํ–ˆ๋‹ค. PostIt์ด๋ผ๋Š” ์ƒˆ๋กœ์šด Obejct๋ฅผ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด์„œ Group์ด๋ผ๋Š” Class๋ฅผ ์‚ฌ์šฉํ•ด์„œ Rect์™€ TextBox๋ฅผ Group์•ˆ์— ๋„ฃ์–ด์„œ ๊ด€๋ฆฌํ•˜๊ธฐ๋กœ ๊ณ„ํšํ–ˆ๋‹ค.

TextBox

Textbox class, based on IText, allows the user to resize the text rectangle and wraps lines automatically. Textboxes have their Y scaling locked, the user can only change width. Height is adjusted automatically based on the wrapping of lines.

Fabric์—์„œ ์ œ๊ณตํ•ด์ฃผ๋Š” Class์ค‘ ํ•˜๋‚˜๋กœ ์—„์ฒญ ์œ ์—ฐํ•œ TextInput์ด๋‹ค.

image

Rect

Fabric์—์„œ ์ œ๊ณตํ•ด์ฃผ๋Š” Class์ค‘ ํ•˜๋‚˜๋กœ ์‚ฌ๊ฐํ˜•์„ ๋‚˜ํƒ€๋‚ด๋Š” Object์ด๋‹ค.

image

Group

Fabric์—์„œ ์ œ๊ณตํ•ด์ฃผ๋Š” Class์ค‘ ํ•˜๋‚˜๋กœ ๊ทธ๋ฃน์„ ๋‚˜ํƒ€๋‚ด๋Š” Obejct์ด๋‹ค. Group์€ ์—ฌ๋Ÿฌ๊ฐ€์ง€ Object๋ฅผ ํ•ฉ์ณ์„œ ํ•œ๋ฒˆ์— ๊ด€๋ฆฌ ํ•  ์ˆ˜ ์žˆ๋‹ค.

image

์œ„ ์ฒ˜๋Ÿผ TextBox์™€ Rect๋ฅผ ํ•œ๋ฒˆ์— ๊ด€๋ฆฌ ํ•  ์ˆ˜ ์žˆ๋‹ค.

TextBox in Group

TextBox.enter

๐Ÿ“š ๊ทธ๋ผ์šด๋“œ ๋ฃฐ

โœ๏ธ ์ปจ๋ฒค์…˜

๐Ÿง‘โ€๐Ÿซ ๋ฉ˜ํ† ๋ง

๐Ÿ“ ์• ์ž์ผ ํ”„๋กœ์„ธ์Šค

๊ธฐํš
๋ฐ์ผ๋ฆฌ ์Šคํฌ๋Ÿผ
์Šคํ”„๋ฆฐํŠธ ๋ฆฌ๋ทฐ
์Šคํ”„๋ฆฐํŠธ ํšŒ๊ณ 
ํŠธ๋Ÿฌ๋ธ” ์ŠˆํŒ…
๊ธฐํƒ€ ์‚ฐ์ถœ๋ฌผ

๐Ÿ“– ๊ธฐ์ˆ ๋ฌธ์„œ

Week2
Week3
Week4
Week5

๐Ÿ—‚ ์ฐธ๊ณ ๋ฌธ์„œ

Clone this wiki locally