Author Topic: Sprite does not contain a definition for 'border'  (Read 5601 times)

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
Sprite does not contain a definition for 'border'
« on: February 09, 2015, 05:12:04 PM »
Hey there.

Imported the latest nGUI Version to my clean new 4.3.X Unity PS Vita Project and got these two errors:

  1. Assets/NGUI/Scripts/Editor/UI2DSpriteEditor.cs(42,46): error CS1061: Type `UnityEngine.Sprite' does not contain a definition for `border' and no extension method `border' of type `UnityEngine.Sprite' could be found (are you missing a using directive or an assembly reference?)

  1. Assets/NGUI/Scripts/Editor/UI2DSpriteEditor.cs(42,46): error CS1061: Type `UnityEngine.Sprite' does not contain a definition for `border' and no extension method `border' of type `UnityEngine.Sprite' could be found (are you missing a using directive or an assembly reference?)

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Sprite does not contain a definition for 'border'
« Reply #1 on: February 09, 2015, 06:58:53 PM »
As far as I know, 4.3 isn't really supported anymore. That said, I believe the only problem should be that one - just commed out the entirety of UI2DSpriteEditor and it should work again.

I'm not sure when the borders were added to unity sprites, but right now that's where NGUI supports from. (4.6?)

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
Re: Sprite does not contain a definition for 'border'
« Reply #2 on: February 10, 2015, 03:30:02 AM »
What? Really? That's really a problem since we need a decent GUI solution for our work on consoles. Hm...

So I only should comment out the whole class?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sprite does not contain a definition for 'border'
« Reply #3 on: February 10, 2015, 05:24:48 AM »
NGUI has been built with Unity 4.5 for many months now. You can take the package and import it in 4.3, but there are parts of the code like the one you found that will need to be adjusted. It's easier to do if you have Professional level access and have full history of files -- you can then just check to see what changed. In most cases it's simply a removal of an #ifdef.

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
Re: Sprite does not contain a definition for 'border'
« Reply #4 on: February 10, 2015, 05:55:42 AM »
So in this specific case what shall I comment out or remove exactly? The whole class or only some lines?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Sprite does not contain a definition for 'border'
« Reply #5 on: February 11, 2015, 03:20:19 AM »
You'll need to remove all references to Unity's sprites, I believe.
 
That means, the contents of UI2DSprite, all of UI2DSpriteEditor, UI2dSpriteAnimation where it references UnityEngine.Sprite. Essentially anywhere else that it references UnityEngine.Sprite.


If you leave the UI2DSprite class existing (but empty), you may not need to remove it from quite so many places.

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
Re: Sprite does not contain a definition for 'border'
« Reply #6 on: February 11, 2015, 04:42:35 AM »
Yesterday I just commented out the two lines of code which gave me the errors and then everything seemed to work fine.
But I'll keep your suggestion in mind, thanks!

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Sprite does not contain a definition for 'border'
« Reply #7 on: February 11, 2015, 06:21:40 AM »
Heh, I may be overstating the problem then. Did the built in unity 2d stuff come already in 4.3? Then it's only certain late additions that would break, like Borders. If so, phew, much easier. :D

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
Re: Sprite does not contain a definition for 'border'
« Reply #8 on: February 11, 2015, 06:54:24 AM »
Yep, the 2D Stuff came in 4.3 :)