Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Mikkel

Pages: [1]
1
Unfortunately getting the following error:

Assets/NGUI/Scripts/UI/UIScrollablePopupList.cs(772,45): error CS0029: Cannot implicitly convert type `void' to `UnityEngine.BoxCollider'

Please if anyone can help it would be much appreciated.

Probably something that changed in NGUI after the "scrollable popup list" was made.

Replace the offending line with this snippet taken from UIPopupList.cs:

  1. NGUITools.AddWidgetCollider(lbl.gameObject);
  2. lbl.autoResizeBoxCollider = false;
  3. BoxCollider bc = lbl.GetComponent<BoxCollider>();

edit: there are a number of other issues with this component - hardly surprising as it's not being actively supported. I was initially going to fix it up for the latest NGUI, but turns out there are more issues than I have time for. Still, the above is correct in so far as it allows the thing to compile.

2
NGUI 3 Support / UILabel - BBCode turns itself off?
« on: August 06, 2015, 08:03:08 AM »
I'm trying to implement emoticons on UILabels (it's unfortunately a must these days for any app featuring chatting options), so...

I looked at the example scenes, which seem to work great, but when I tried to implement it using my own font (Bitmap font generated with BMFont) with some custom emoticons in the atlas... it doesn't work. Turns out BBCode turns itself off on scene load (??), for no reason that I can find.

Any idea of why this could be? My scene setup is as simple as it gets:
UIRoot
 -Camera
 -Sprite w/UIInput
 -UILabel w/BBCode turned on (if I input some of the emoticon code in the editor it works in the editor, but turns itself off when I press Play).

What I would ideally like to do was offload the whole hassle to the OS, but I don't think that's possible (developing for Android and iOS), but if it is... any pointers are very welcome. Using Unity 4.6.3. Will probably migrate to Unity 5 at some point, but not for a while yet.

3
NGUI 3 Support / Re: UITexture offset - shader?
« on: April 15, 2015, 04:47:44 AM »
Well... I may have found the answer myself (doesn't that always happen right after you ask for help?).

Solution 1:

If I do

  1.  
  2. //bgTex is the UITexture component in question
  3.  
  4. bgTex.mainTexture.wrapMode = TextureWrapMode.Repeat;
  5.  
  6. //and then do whatever offset is needed:
  7. Rect uvRect = bgTex.uvRect;
  8. uvRect.x = 0.25f;
  9. bgTex.uvRect = uvRect;
  10.  
  11.  

Solution 2, which is simpler, and just fine in case you don't need or want to do this in code:

Set the texture to be a.. texture (rather than sprite) :-[ in the editor, and set the wrapmode to repeat (which is exactly what I do above, in code). Then manipulate the UVRect either in code or editor as you prefer. Simple - and not really much of an NGUI question at all, but I leave the answer anyway, in case someone suffering from too little sleep (like yours truly) runs into the same thing.

4
NGUI 3 Support / [Solved] UITexture offset - shader?
« on: April 15, 2015, 03:20:25 AM »
Hi, I've been using NGUI for a couple of years now (paid version, of course!), but now I'm moving into uncharted waters (as it were), at least for me.

I'm in need of being able to "offset" the UVs of a UITexture, without clipping the texture. I can offset it just fine (see example), but it seems to clip the texture, then.

If I try manipulating the UVRect X or Y, parts of the texture gets cut - probably as intended, but it doesn't do what I need. What I would like is to be able to offset the uvs (I think), via code at runtime.

I'm not going to be doing it every frame, only after certain user-initiated events complete, whereupon I will need to update the texture. Moving or resizing the UITexture itself is not really an option, I just want to offset the image that appears on it (which is tileable of course!).

I've tried looking into customizing the shader, but honestly I'm in over my head on that subject.

Any chance anyone can shine some light on this subject?

Included is a (simplified) example of the actual vs desired results.

Pages: [1]