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 - 对象

new_object(name: str) -> GameObject

示例
描述
在当前房间中创建指定名称对象的新实例。你也可以直接调用类 Name() 来实例化该类,其中 Name 是类的名称
参数
name
要实例化的 GameObject 资源的名称,字符串类型。

返回值
指定名称的 GameObject 资源的新实例。

destroy(obj: GameObject) -> GameObject

示例
描述
销毁一个 gameObject 实例。
参数
obj
要销毁的 GameObject 实例

返回值
无返回值。

对象

对象(有时也称为 GameObject)是任何 PixelPAD2D 项目的主要组成部分。每个对象代表项目中一个活动的“事物”。和房间一样,每个对象都由对象脚本定义,脚本描述了对象的外观、它如何对其他对象做出反应等内容。一个房间可以拥有任意数量的活动对象,但切换房间时它们都会被销毁。要创建新对象,请使用 new_object 函数。

脚本

Start - 对象的 Start 标签页包含在 GameObject 实例创建后立即运行的代码。例如为对象设置一个“精灵”(一张计算机图像)。

Loop - 对象的 Loop 标签页包含在对象处于活动状态时每秒运行多次的代码。例如控制玩家的移动。

Built-in Object Variables

x
The x position of an object. Default 0. Positive values move objects to the right.
y
The y position of an object. Default 0. Positive values moves objects upwards.
z
The z position of an object. Default 0. Positive values moves objects to the upper layer.
sprite
A sprite is a computer image. Setting the sprite value on an object will change the image of that object.
scaleX
scaleX allows you to expand/shrink the object over the X axis. This affects the width of the current sprite as well as the collision mask. 1 is the default size, 0.5 is half, 2 is double.
scaleY
scaleY allows you to expand/shrink the object over the Y axis. This affects the height of the current sprite as well as the collision mask. 1 is the default size, 0.5 is half, 2 is double.
skewX
skewX rotates the object around the X axis in degrees.
skewY
skewY rotates the object around the Y axis in degrees.
angle
Angle determines the rotation the object takes in degrees.
visible
visible (boolean) determines if object is visible.
alpha
alpha (float) determines the opacity of the object. 0 is invisible, 1 is fully visible. 0.5 is half opacity.
persistent
persistent (boolean) determines if the object persists between rooms. Default is False. If set to False, objects will be destroyed when changing rooms. If set to True, objects will not be destroyed when changing rooms.
PixelPAD
关于我们
Discord
Arm 版本 3.0.1013
资源
文档
EULA
隐私政策
联系我们
hello@pixelpad.io
简体中文
English Deutsch Español Français Português 日本語 简体中文 繁體中文 한국어
© 2026 保留所有权利。
PixelPAD.io
Logo

欢迎回来!

登录后继续创作

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

还没有账号?

Logo

创建你的账号

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

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

已有账号? 登录

Logo

以教育者身份加入

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

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

已有账号? 登录