pixijs / lights

Adds dynamic lighting via deferred shading to PixiJS
https://pixijs.io/lights/docs/index.html
MIT License
205 stars 29 forks source link

Is it possible to show different images for different viewports? #31

Open slaetthult opened 5 years ago

slaetthult commented 5 years ago
// Add the background diffuse color
const diffuse = Sprite.fromImage('images/BGTextureTest.jpg');
diffuse.parentGroup = diffuseGroup;

// Add the background normal map
const normals = Sprite.fromImage('images/BGTextureNORM.jpg');
normals.parentGroup = normalGroup;

Is there a possibility to change/overwrite the image for "diffuse" and "normals" when user changes the viewport/ resizes the browser window? I want to show different images for mobile, tablet and desktop.

ivanpopelyshev commented 5 years ago

Just like in normal pixi sprites, you can change the texture or sprite size.

ivanpopelyshev commented 5 years ago

I warn you that if you have that kind of question about PixiJS, managing this plugin might be a problem, Also, serious modification of examples will require knowledge of pixi-display plugin. Concentrate and prepare for difficulties.

Or it might be easy, for example guy who looked at that plugin for several days made his own shadows plugin #28