Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> JavaScript

Properties สร้างข้อความด้วย HTML5 Canvas

textBaseline [ = value ] คืนค่า baseline alignment ปัจจุบัน ตั้งค่าเปลี่ยน alignment ค่าที่เป็นไปได้: top, hanging, middle, alphabetic, ideographic, bottom

Properties สำหรับสร้างข้อความ:

Sr.No.Property and Description
1font [ = value ]
คืนค่า font settings ปัจจุบัน ตั้งค่าเปลี่ยน font
2textAlign [ = value ]
คืนค่า text alignment ปัจจุบัน ตั้งค่าเปลี่ยน alignment ค่า: start, end, left, right, center
3textBaseline [ = value ]
คืนค่า baseline alignment ปัจจุบัน ตั้งค่าเปลี่ยน ค่า: top, hanging, middle, alphabetic, ideographic, bottom
4fillText(text, x, y [, maxWidth])
เติมข้อความที่ตำแหน่งพิกัด x, y
5strokeText(text, x, y [, maxWidth])
ขีดข้อความที่ตำแหน่งพิกัด x, y