Some content could not load. We could not load files from our content delivery networks (CDN).
Your network may be blocking access. Ask your IT to allow loading from: .
Network domains required
We use these CDNs to deliver the files the site needs to run, please allow the following:
Domains to allow Used for
cdn.jsdelivr.net styles and JavaScript libraries.
cdnjs.cloudflare.com JavaScript libraries and icons.
code.jquery.com jQuery and jQuery UI.
pixelpad.io, cdn.pixelpad.io CDN of images, sounds, and application files.
cdn.datatables.net Interactive tables.
fonts.googleapis.com, fonts.gstatic.com Fonts stylesheets and font files.
s3.us-west-1.amazonaws.com, s3-us-west-1.amazonaws.com Project files stored on Amazon S3.
vmwan2cvlyzeklq4knz63qh6d40lewka.lambda-url.us-west-1.on.aws Amazon AWS Project play counters.
nexushud.org Learning assistant.
u45ivsqoja6u3sk7zaliv37zq40hpbxk.lambda-url.us-west-1.on.aws Amazon AWS AI character responses, when used.
  • 探索
  • 學習
  • 登入
  • 簡介
  • 遊戲
  • Start 與 Loop
  • 物件
  • 精靈
  • 動畫
  • 聲音
  • 房間
  • 輸入
  • 碰撞
  • 函式
  • 攝影機
  • FPS
  • 文字
  • 繪圖
  • 濾鏡
  • 多人連線
  • AI

PixelPAD 2D - 繪圖

draw_rectangle(x1 :number, y1 :number, x2 :number, y2 :number, lineThickness :number, lineColor :number, fillColor :number) -> graphic

範例
說明
在兩個角之間畫一個矩形,並回傳一個可以移動、隱藏或銷毀的圖形。
參數
x1
左邊緣的 x 位置。

y1
下邊緣的 y 位置。

x2
右邊緣的 x 位置。

y2
上邊緣的 y 位置。

lineThickness
邊框的粗細,單位為像素。

lineColor
邊框顏色,為十六進位數字,例如 0xFF0000。

fillColor
內部填滿顏色,為十六進位數字。

回傳值
圖形物件

draw_ellipse(x :number, y :number, width :number, height :number, lineThickness :number, lineColor :number, fillColor :number) -> graphic

範例
說明
以中心點畫一個橢圓。
參數
x
中心的 x 位置。

y
中心的 y 位置。

width
橢圓從中心向左右延伸的距離。

height
橢圓從中心向上下延伸的距離。

lineThickness
邊框的粗細,單位為像素。

lineColor
邊框顏色,為十六進位數字。

fillColor
內部填滿顏色,為十六進位數字。

回傳值
圖形物件

draw_polygon(points :list, lineThickness :number, lineColor :number, fillColor :number) -> graphic

範例
說明
依照角點串列畫出一個形狀。最後一個點會連回第一個點。
參數
points
[x, y] 配對的串列,每個角一組。

lineThickness
邊框的粗細,單位為像素。

lineColor
邊框顏色,為十六進位數字。

fillColor
內部填滿顏色,為十六進位數字。

回傳值
圖形物件

draw_arc(x :number, y :number, radius :number, startAngle :number, endAngle :number, lineThickness :number, lineColor :number, fillColor :number) -> graphic

範例
說明
畫出圓的一部分。角度單位為度,從右側開始逆時針計算。
參數
x
中心的 x 位置。

y
中心的 y 位置。

radius
弧線與中心的距離。

startAngle
弧線開始的角度,單位為度。

endAngle
弧線結束的角度,單位為度。

lineThickness
線條的粗細,單位為像素。

lineColor
線條顏色,為十六進位數字。

fillColor
內部填滿顏色。省略則不填滿。

回傳值
圖形物件

draw_line(x1 :number, y1 :number, x2 :number, y2 :number, lineThickness :number, lineColor :number) -> graphic

範例
說明
在兩點之間畫一條直線。
參數
x1
線條起點的 x 位置。

y1
線條起點的 y 位置。

x2
線條終點的 x 位置。

y2
線條終點的 y 位置。

lineThickness
線條的粗細,單位為像素。

lineColor
線條顏色,為十六進位數字。

回傳值
圖形物件

圖形屬性

Every draw function hands back a graphic object. Change these properties to move it, fade it or hide it.
box.x = 100 sets the x position to 100
box.y = 100 sets the y position to 100
box.z = 1000 draws it in front of anything with a lower z
box.angle = 45 turns it 45 degrees counter-clockwise
box.alpha = 0.5 makes it half see-through
box.visible = False hides it without destroying it
box.scaleX = 2 sets the width to 200%
box.scaleY = 2 sets the height to 200%
When you are finished with a graphic, remove it with destroy(box). The same destroy() works on objects and text too.
PixelPAD
繁體中文
English Deutsch Español Français Português 日本語 简体中文 繁體中文 Türkçe 한국어
Discord
Arm 版本 3.0.1096
資源
文件
EULA
隱私權政策
聯絡我們
hello@pixelpad.io
© 2026 版權所有。
PixelPAD.io
Logo

歡迎回來!

登入後繼續創作

登入或註冊即可儲存你的專案。
忘記密碼?

還沒有帳號?

Logo

建立你的帳號

加入 PixelPad 上成千上萬的創作者

登入或註冊即可儲存你的專案。
依據隱私相關法律,你必須在建立帳號前確認年齡。

已經有帳號了? 登入

Logo

Create your account

Password must:
Be at least 8 characters
Include 1 alphabetical character
Include 1 number or special character
By signing up, you agree to PixelPAD's Terms of Service and 隱私權政策.

已經有帳號了? 登入