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
  • INICIAR SESIÓN
  • 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

Ejemplo
Descripción
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.

Devuelve
A graphic object

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

Ejemplo
Descripción
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.

Devuelve
A graphic object

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

Ejemplo
Descripción
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.

Devuelve
A graphic object

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

Ejemplo
Descripción
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.

Devuelve
A graphic object

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

Ejemplo
Descripción
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.

Devuelve
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 nosotros
Discord
Versión Arm 3.0.943
Recursos
Documentación
EULA
Política de privacidad
Contáctanos
hello@pixelpad.io
© 2026 Todos los derechos reservados.
PixelPAD.io
Español
English Deutsch Español Français Português 日本語 简体中文 繁體中文 한국어
Logo

¡Hola de nuevo!

Inicia sesión para seguir creando

Guarda tu proyecto iniciando sesión o registrándote.
¿Has olvidado tu contraseña?

¿No tienes cuenta?

Logo

Crea tu cuenta

Únete a miles de creadores en PixelPad

Guarda tu proyecto iniciando sesión o registrándote.

¿Ya tienes cuenta? Iniciar sesión

Logo

Únete como docente

Dale a tus estudiantes herramientas creativas

Crea aulas y supervisa el progreso de tus estudiantes.

¿Ya tienes cuenta? Iniciar sesión