第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何使用 Phaser 3 繪制多邊形?

如何使用 Phaser 3 繪制多邊形?

慕桂英546537 2021-07-02 01:06:23
我正在嘗試使用 Phaser 3 框架繪制一個(gè)簡(jiǎn)單的多邊形形狀。問(wèn)題是:多邊形沒(méi)有出現(xiàn)。var config = {        type:Phaser.AUTO,        width:800,        height:600,        scene: {            preload: preload,            create: create,        }    };    var game = new Phaser.Game(config);    var poly;    var graphics;    function preload() {}    function create() {        poly = new Phaser.Geom.Polygon();        poly.setTo([ new Phaser.Geom.Point(200, 100), new Phaser.Geom.Point(350, 100), new Phaser.Geom.Point(375, 200), new Phaser.Geom.Point(150, 200) ]);        graphics = this.add.graphics(0, 0);        graphics.fillPoints(poly.points, true);    }我得到的錯(cuò)誤是:“Phaser.Polygon 不是構(gòu)造函數(shù)”,但我在有關(guān) Phaser 的教程中看到了該代碼。編輯:我按照 PhotonStorm 的建議更改了代碼,現(xiàn)在我沒(méi)有收到錯(cuò)誤,但多邊形仍然沒(méi)有出現(xiàn)。EDIT2:通過(guò)在圖形對(duì)象上調(diào)用 lineStyle 和 fillStyle 來(lái)解決。graphics = this.add.graphics(0, 0);graphics.lineStyle(5, 0xFF00FF, 1.0);graphics.fillStyle(0xFFFFFF, 1.0);graphics.fillPoints(poly.points, true);
查看完整描述

1 回答

?
森欄

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超5個(gè)贊

它是Phaser.Geom.Polygon。


這是它的文檔頁(yè)面


一個(gè)基本的例子:


    var polygon = new Phaser.Geom.Polygon([

        400, 100,

        200, 278,

        340, 430,

        650, 80

    ]);


查看完整回答
反對(duì) 回復(fù) 2021-07-08
  • 1 回答
  • 0 關(guān)注
  • 341 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)