Skip to content

Commit b87a95f

Browse files
committed
support WEBGL
1 parent 54433d4 commit b87a95f

File tree

5 files changed

+14
-20
lines changed

5 files changed

+14
-20
lines changed

build/phaser-inspector.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -59325,12 +59325,10 @@ var DisplayObject = (function () {
5932559325
get: function get() {
5932659326
var img = {};
5932759327
var texture = this.obj.texture;
59328-
if (texture && texture.baseTexture && texture.baseTexture.source) {
59328+
if (texture && texture.baseTexture) {
5932959329
var source = texture.baseTexture.source;
59330-
if (source.src) img.url = source.src;else if (source.toDataURL) {
59331-
try {
59332-
img.url = source.toDataURL();
59333-
} catch (err) {}
59330+
if (source && source.src) img.url = source.src;else if (texture.getBase64) {
59331+
img.url = texture.getBase64();
5933459332
}
5933559333
if (img.url) {
5933659334
var frame = texture.frame;

build/phaser-inspector.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/phaser-inspector/phaser-inspector.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -59325,12 +59325,10 @@ var DisplayObject = (function () {
5932559325
get: function get() {
5932659326
var img = {};
5932759327
var texture = this.obj.texture;
59328-
if (texture && texture.baseTexture && texture.baseTexture.source) {
59328+
if (texture && texture.baseTexture) {
5932959329
var source = texture.baseTexture.source;
59330-
if (source.src) img.url = source.src;else if (source.toDataURL) {
59331-
try {
59332-
img.url = source.toDataURL();
59333-
} catch (err) {}
59330+
if (source && source.src) img.url = source.src;else if (texture.getBase64) {
59331+
img.url = texture.getBase64();
5933459332
}
5933559333
if (img.url) {
5933659334
var frame = texture.frame;

example/phaser-inspector/phaser-inspector.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/classes/DisplayObject.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,11 @@ export default class DisplayObject {
113113
get img(){
114114
var img = {};
115115
var texture = this.obj.texture;
116-
if ( texture && texture.baseTexture && texture.baseTexture.source) {
116+
if ( texture && texture.baseTexture) {
117117
var source = texture.baseTexture.source;
118-
if (source.src) img.url = source.src;
119-
else if (source.toDataURL) {
120-
try {
121-
img.url = source.toDataURL();
122-
} catch(err) {}
118+
if (source && source.src) img.url = source.src;
119+
else if (texture.getBase64) {
120+
img.url = texture.getBase64();
123121
}
124122
if (img.url) {
125123
var frame = texture.frame;

0 commit comments

Comments
 (0)