Author Topic: Inline SpriteAssets don't get masked by 2DRectMask  (Read 1822 times)

TitanUnity

  • Newbie
  • *
  • Posts: 16
Inline SpriteAssets don't get masked by 2DRectMask
« on: June 30, 2016, 01:29:50 PM »
Hi,

I'm currently using Unity 5.3.5p5, (we're rolling an update to our game within the next few weeks and aren't ready to update to the Unity 1.5.4 beta.  I have an issue with a scroll rect that is masked with a 2DRectMask.

I've noticed that some of my inline SpriteAssets within TextMeshProUGUI text fields don't get masked by the 2D RectMask as the scroll rect contents are scrolled outside the masked area.  Everything else works fine, and if I switch my mask back to a normal Mask component it works fine... but the performance is reduced.  Any idea how I can fix this?   In the below, you can see how the little clock icon is not being masked.

[ Guests cannot view attachments ]

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5320
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #1 on: June 30, 2016, 01:35:12 PM »
Hi,

I'm currently using Unity 5.3.5p5, (we're rolling an update to our game within the next few weeks and aren't ready to update to the Unity 1.5.4 beta.  I have an issue with a scroll rect that is masked with a 2DRectMask.

I've noticed that some of my inline SpriteAssets within TextMeshProUGUI text fields don't get masked by the 2D RectMask as the scroll rect contents are scrolled outside the masked area.  Everything else works fine, and if I switch my mask back to a normal Mask component it works fine... but the performance is reduced.  Any idea how I can fix this?   In the below, you can see how the little clock icon is not being masked.

(Attachment Link)

Let me take a look to see what's going on here.

What version of TMP are you currently using?

Update
I did a quick test and the sprites are getting correctly masked on my end.

Can you provide me with a simple Repro of that scene to make it easy for me to reproduce this?
« Last Edit: June 30, 2016, 01:39:19 PM by Stephan B. »

TitanUnity

  • Newbie
  • *
  • Posts: 16
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #2 on: June 30, 2016, 01:42:13 PM »
I was actually trying to locate the version number within my build and haven't found it yet, still looking.. is there an easy place to see that?

TitanUnity

  • Newbie
  • *
  • Posts: 16
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #3 on: June 30, 2016, 01:44:16 PM »
User Manual says:  Beta 0.1.46 & 0.1.5
Inline Graphic Manager says: Beta Release 1.46 Beta 4
TextMeshProUgUI says:  1.52 Beta 3

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5320
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #4 on: June 30, 2016, 01:44:32 PM »
I was actually trying to locate the version number within my build and haven't found it yet, still looking.. is there an easy place to see that?

The version number is located in the header of the TextMeshPro.cs file.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5320
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #5 on: June 30, 2016, 01:47:16 PM »
User Manual says:  Beta 0.1.46 & 0.1.5
Inline Graphic Manager says: Beta Release 1.46 Beta 4
TextMeshProUgUI says:  1.52 Beta 3

I suggest you update to the latest release which is 0.1.54 Beta 4 which is available in the "TMP - Alpha & Beta Releases" section of the user forum.

Please be sure to backup your project first and to carefully review the release notes as a lot of stuff has changed including handling of sprites as the Inline Graphic manager is no longer in use.

The following video covers changes to the Sprite Asset Creation process and changes to the <sprite> tag.

TitanUnity

  • Newbie
  • *
  • Posts: 16
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #6 on: June 30, 2016, 01:50:26 PM »
I did try the latest Beta already, but it did not fix the problem... (I thought maybe it didn't work because I'm still using Unity 5.3.5, so I reverted)

TitanUnity

  • Newbie
  • *
  • Posts: 16
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #7 on: June 30, 2016, 01:51:40 PM »
I'm looking into creating a reproduction, but given the complexity of my project, I'm not sure I'll be able to reproduce.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5320
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #8 on: June 30, 2016, 01:59:56 PM »
I'm looking into creating a reproduction, but given the complexity of my project, I'm not sure I'll be able to reproduce.

The latest releases include a lot of improvements and fixes so I do suggest you update to the latest.

In terms of a Repro, just creating a new scene and reproducing the setup / hierarchy of the current text object exhibiting the issue and its immediate parents with the 2D RectMask should prove useful.

TitanUnity

  • Newbie
  • *
  • Posts: 16
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #9 on: June 30, 2016, 02:11:39 PM »
Ok I was able to create a reproduction project for you.  You'll see as you grab and slide the teal area upward the masking only applies to the text.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5320
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #10 on: June 30, 2016, 02:14:25 PM »
Ok I was able to create a reproduction project for you.  You'll see as you grab and slide the teal area upward the masking only applies to the text.

Taking a look at the Repro now. Will provide an update as soon as I have something for you.

Update
Upgrading to the latest release does fix the issue.

I am creating a video to document the upgrade process using this Repro project to help guide you through the upgrade.

I should have this done within 30 minutes.
« Last Edit: June 30, 2016, 02:23:38 PM by Stephan B. »

TitanUnity

  • Newbie
  • *
  • Posts: 16
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #11 on: June 30, 2016, 02:28:00 PM »
Awesome, ok I'm reinstalling 1.5.4 Beta 4 update.  I'll see if I can get it to work in my setup.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5320
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #12 on: June 30, 2016, 03:50:37 PM »
Here is the video covering the upgrade process and how to fix the sprite assets.

<a href="https://www.youtube.com/v/2sQyCK_YMik" target="_blank" class="new_win">https://www.youtube.com/v/2sQyCK_YMik</a>
« Last Edit: June 30, 2016, 04:10:56 PM by Stephan B. »

TitanUnity

  • Newbie
  • *
  • Posts: 16
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #13 on: July 01, 2016, 07:20:02 AM »
I've updated my project, and after a decent bit of restructuring away from the InlineGraphicManagers things are working. Thanks!

TitanUnity

  • Newbie
  • *
  • Posts: 16
Re: Inline SpriteAssets don't get masked by 2DRectMask
« Reply #14 on: July 01, 2016, 10:03:11 AM »
Gave you a quick shoutout on our dev blog for BioBeasts, thanks again:
http://biobeasts.artix.com/biobeasts-1-5-0-coming-soon/