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.
  • 探索
  • 学习
  • 登录
  • Introduction
  • Game
  • Start-loop
  • Objects
  • Sprites
  • Animation
  • Sounds
  • Rooms
  • Input
  • Collision
  • Functions
  • Camera
  • Fps
  • Text
  • Graphics
  • Filters
  • Multiplayer
  • Ai

PixelPAD 2D - graphics

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

示例
描述
Draws a rectangle between two corners and gives you back a graphic you can move, hide or destroy.
参数
x1
The x position of the left edge.

y1
The y position of the bottom edge.

x2
The x position of the right edge.

y2
The y position of the top edge.

lineThickness
How thick the border is, in pixels.

lineColor
The border colour, as a hex number like 0xFF0000.

fillColor
The inside colour, as a hex number.

返回值
A graphic object

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

示例
描述
Draws an ellipse around a centre point.
参数
x
The x position of the centre.

y
The y position of the centre.

width
How far the ellipse reaches left and right of the centre.

height
How far the ellipse reaches above and below the centre.

lineThickness
How thick the border is, in pixels.

lineColor
The border colour, as a hex number.

fillColor
The inside colour, as a hex number.

返回值
A graphic object

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

示例
描述
Draws a shape from a list of corner points. The last point joins back to the first.
参数
points
A list of [x, y] pairs, one for each corner.

lineThickness
How thick the border is, in pixels.

lineColor
The border colour, as a hex number.

fillColor
The inside colour, as a hex number.

返回值
A graphic object

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

示例
描述
Draws part of a circle. The angles are in degrees, going anticlockwise from the right.
参数
x
The x position of the centre.

y
The y position of the centre.

radius
How far the arc sits from the centre.

startAngle
The angle the arc starts at, in degrees.

endAngle
The angle the arc ends at, in degrees.

lineThickness
How thick the line is, in pixels.

lineColor
The line colour, as a hex number.

fillColor
The inside colour. Leave it out for no fill.

返回值
A graphic object

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

示例
描述
Draws a straight line between two points.
参数
x1
The x position the line starts at.

y1
The y position the line starts at.

x2
The x position the line ends at.

y2
The y position the line ends at.

lineThickness
How thick the line is, in pixels.

lineColor
The line colour, as a hex number.

返回值
A graphic object

graphic properties

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
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
关于我们
Discord
Arm 版本 3.0.943
资源
文档
EULA
隐私政策
联系我们
hello@pixelpad.io
© 2026 保留所有权利。
PixelPAD.io
简体中文
English Deutsch Español Français Português 日本語 简体中文 繁體中文 한국어
Logo

欢迎回来!

登录后继续创作

登录或注册即可保存你的项目。
忘记密码?

还没有账号?

Logo

创建你的账号

加入 PixelPad 上成千上万的创作者

登录或注册即可保存你的项目。

已有账号? 登录

Logo

以教育者身份加入

用创意工具激发学生的创造力

创建班级并跟踪学生的学习进度。

已有账号? 登录