pixijs / lights

Adds dynamic lighting via deferred shading to PixiJS

Home Page:https://pixijs.io/lights/docs/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to show different images for different viewports?

slaetthult opened this issue · comments

// 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.

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

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