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

以教育者身分加入

用創意工具,讓你的學生大展身手

建立班級並追蹤學生的學習進度。

已經有帳號了? 登入