Jump to content

What am i doing wrong using Pixi-layers for basic sight ?


Recommended Posts

Hello, my game project is a little bit similar to this :


I'm trying to make the screen darker and to remove this darker effect around units, but it is not working and the sight effect is just a black circle 

i don't understand why, i inspired myself with the lighting example https://pixijs.io/examples/#/plugin-layers/lighting.js

Thanks for help.

Link to comment
Share on other sites

a few fixes:

1. spr.drawRect(i*32, j*32, 32, 32)

2. app.stage.addChild(lightingSprite)  . lightingSprite should cover everything, it should be rendered after all elements of the map, its the resulting texture of all your lights.

3. 0x000000 ? those circles are doing nothing.

Even with all the fixes, I dont see the exact problem. Maybe its because its 2:40AM here. 

Check layer _activeChildren if they were actually dynamically added.

Edited by ivan.popelyshev
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...