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.
  • EXPLORAR
  • APRENDER
  • ENTRAR
  • 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

Exemplo
Descrição
Draws a rectangle between two corners and gives you back a graphic you can move, hide or destroy.
Parâmetros
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.

Retorno
A graphic object

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

Exemplo
Descrição
Draws an ellipse around a centre point.
Parâmetros
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.

Retorno
A graphic object

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

Exemplo
Descrição
Draws a shape from a list of corner points. The last point joins back to the first.
Parâmetros
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.

Retorno
A graphic object

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

Exemplo
Descrição
Draws part of a circle. The angles are in degrees, going anticlockwise from the right.
Parâmetros
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.

Retorno
A graphic object

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

Exemplo
Descrição
Draws a straight line between two points.
Parâmetros
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.

Retorno
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
Sobre nós
Discord
Versão Arm 3.0.943
Recursos
Documentação
EULA
Política de privacidade
Fale conosco
hello@pixelpad.io
© 2026 Todos os direitos reservados.
PixelPAD.io
Português
English Deutsch Español Français Português 日本語 简体中文 繁體中文 한국어
Logo

Que bom ter você de volta!

Entre para continuar criando

Salve seu projeto entrando ou criando uma conta.
Esqueceu a senha?

Não tem uma conta?

Logo

Crie sua conta

Junte-se a milhares de criadores no PixelPad

Salve seu projeto entrando ou criando uma conta.

Já tem uma conta? Entrar

Logo

Cadastre-se como educador

Dê aos seus alunos ferramentas criativas

Crie turmas e acompanhe o progresso dos seus alunos.

Já tem uma conta? Entrar