Author Topic: Simulated masking  (Read 2069 times)

Alan Gray

  • Guest
Simulated masking
« on: July 26, 2012, 07:47:43 PM »
I'm trying to simulate masking by putting an "alpha hole" in a texture and the texture to be masked behind the hole. I think the problem I'm having is that the texture to be masked is a dynamic texture and not in an atlas. Everything else is regular atlas textures. The dynamic texture is the Game Center leaderboard photo - so it's dynamically loaded at run-time. I can't seem to get the UITexture to sort in between the other two textures. I have everything offset in Z as well as using the Depth order for the atlas textures. Any advice on how to get this working?


------------------------ <- background texture (UISprite from atlas)
          ------         <- dynamic UITexture
   --------    ----      <- texture with "alpha hole" (UISprite from atlas)


ryan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 90
    • View Profile
Re: Simulated masking
« Reply #1 on: July 26, 2012, 08:15:12 PM »
Put the background sprite and the foreground sprite in different UIPanels, or use separate atlases for them.  If they're in the same atlas and panel, they'll be drawn in a single draw call, so everything will either be on top of or behind the dynamic texture as you're seeing.

Alan Gray

  • Guest
Re: Simulated masking
« Reply #2 on: July 26, 2012, 08:20:20 PM »
It's all in a drag-panel - so separate panels would be tough. But I'll try separate atlases - thanks!

Alan Gray

  • Guest
Re: Simulated masking
« Reply #3 on: July 27, 2012, 01:37:25 AM »
Worked like a charm - thanks!