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.
  • EXPLORER
  • APPRENDRE
  • CONNEXION
  • 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

Exemple
Description
Draws a rectangle between two corners and gives you back a graphic you can move, hide or destroy.
Paramètres
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.

Valeur de retour
A graphic object

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

Exemple
Description
Draws an ellipse around a centre point.
Paramètres
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.

Valeur de retour
A graphic object

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

Exemple
Description
Draws a shape from a list of corner points. The last point joins back to the first.
Paramètres
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.

Valeur de retour
A graphic object

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

Exemple
Description
Draws part of a circle. The angles are in degrees, going anticlockwise from the right.
Paramètres
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.

Valeur de retour
A graphic object

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

Exemple
Description
Draws a straight line between two points.
Paramètres
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.

Valeur de retour
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
À propos de nous
Discord
Version Arm 3.0.943
Ressources
Documentation
EULA
Politique de confidentialité
Nous joindre
hello@pixelpad.io
© 2026 Tous droits réservés.
PixelPAD.io
Français
English Deutsch Español Français Português 日本語 简体中文 繁體中文 한국어
Logo

Bon retour!

Connecte-toi pour continuer à créer

Enregistre ton projet en te connectant ou en créant un compte.
Mot de passe oublié?

Tu n'as pas de compte?

Logo

Crée ton compte

Rejoins des milliers de créateurs sur PixelPad

Enregistre ton projet en te connectant ou en créant un compte.

Tu as déjà un compte? Connecte-toi

Logo

Crée ton compte enseignant

Donne à tes élèves des outils créatifs

Crée des classes et suis la progression de tes élèves.

Tu as déjà un compte? Connecte-toi