> For the complete documentation index, see [llms.txt](https://www.psmonkey.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.psmonkey.org/ruan-ti-kai-fa/js/pixi.md).

# pixi.js

> ## pixi.js \#

* 官網：<http://www.pixijs.com/>
* repo：<https://github.com/pixijs/pixi.js>
* API：<http://pixijs.github.io/docs/>
* ~~比文件好用的~~ Example：<http://pixijs.github.io/examples>

### PIXI

#### autoDetectRenderer() ##\#

`options` 還可以有這些 field：

* backgroundColor: 0xFFFFFF

#### loader.add() ##\#

第一個參數可以直接給 object，field 如下：

* url
* name / key：如果沒給的話就會用 url 的值
* onComplete / callback：load 完會觸發的 function

### DisplayObject

`foo.interactive = true` 之後，`foo` 就可以發出 event，處理方式。

```javascript
foo.click = wtfFunc;
foo.on("mouseup", wtfFunc)

function wtfFunc(event) {
    //event 是 pixi 重新包裝過的 `InteractionData`
}
```

其實起點都是 `InteractionManager.prototype.processMouseUp()`，行為好像也差不多， 只不過第二個 `EventEmitter` 的行為...... Zzz

## 瀏覽器差異

### 圖檔無法顯示

* 4.3.0
* Chrome / App WebViewer @ Android

如果要顯示的圖檔尺寸過大（不確定實際數字，4200 *4200 確定炸、4000* 4000 確定不會）， 在 Android 上的 Chrome / App WebViewer 就會無法載入圖檔。

Desktop 的 Chrome 基本上沒有這個問題。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.psmonkey.org/ruan-ti-kai-fa/js/pixi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
