Author Topic: Widget's mesh control  (Read 3104 times)

Samuraisa

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Widget's mesh control
« on: January 18, 2015, 02:21:05 PM »
Hi! I made a search on topics, but found nothing really close to my case. So...

In simple way the question is:
Can I get the direct link to the mesh (MeshFilter ?) of the widget via script and how?

The problem is:
I have a clickable "Fallout 2"-style map on NGUI inside clipped panel. And I want to create an solid-mesh overlay with the same texture (but some dark-colored) as background with a "fog of war" principles so only the explored cells and adjacent to them get revealed (alpha of corresponding vertices set to 0 and 0.5 respectively). So I want to substitute the original overlay-widget's mesh with my own to get desired partitioning and control.
Using of grid of separate NGUI textures have other effect (all vertices have the same alpha, so no gradient).
« Last Edit: January 18, 2015, 02:28:24 PM by Samuraisa »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Widget's mesh control
« Reply #1 on: January 19, 2015, 11:35:14 AM »
No, you can't access the NGUI's mesh filters because they are created after combining widgets and can change at will.

To do a map, simply use textures. UITexture will draw any material for you like you normally would using something like a flat quad. You can specify a shader that will blend 2 textures for you -- one for the game map and another for the fog of war.

Tasharen's Fog of War package is what I used in Windward and did exactly that.