Author Topic: Texture Masks  (Read 4529 times)

echeg

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Texture Masks
« on: September 21, 2015, 12:55:46 PM »
Hello.
I was faced with a simple problem that can not decide.
I'm creating a training game. In certain areas it is necessary to make the dark while others leave the light.
https://yadi.sk/i/92ilCfEPjEMTG
I can of course each tutorial, make a texture size of the screen and leave it in the hole. And use Texture Mask on UIPanel
But these screens will be learning a couple of dozen. And you do not want to do for each texture size of 2048x1536.
I also have a situation where area that should remain is not darkened at a random location.

Ideally, I need to place multiple circles, and that everything around them was dark and bright inside them.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Texture Masks
« Reply #1 on: September 26, 2015, 03:32:22 PM »
Think the reverse. Create a circle that's transparent in the middle, and has opaque corners (the exact opposite of the mask you are thinking of making). Now create 4 square widgets and cover the screen accordingly. You don't need any shaders, all you need to do is position your widgets via code.