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 - zazery

Pages: [1] 2
1
NGUI 3 Support / Re: Making a card game with NGUI.
« on: April 08, 2014, 03:13:05 PM »
I've done this for a contract job and my own project. There is nothing special you need to know when working with NGUI. For each card type build a prefab consisting of a group of sprites and labels. Try to avoid overdraw as much as possible. I load the data from a CSV file and build a model (MVC). The script on the card prefab takes the model representation and hides/tints/changes the sprites and labels. Using UIGrid and a ScrollView is a quick way to handle prototyping a hand of cards.

One thing you will need to worry about is overlapping cards in the same panel. Since the cards are made out of multiple widgets their depths will intersect with each other. You will need to manage the depths manually.

2
Whoops completely misread that.

3
I believe you need to change the UIScrollView from MomentumAndSpring to Momentum. If you want the spring then but don't want the scrollbar to change you need to write a custom scrollbar.

4
NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: March 05, 2014, 03:16:19 AM »
Add "Set as Current" button on Tween*s' inspector please

You can already do that, checkout the options in the gear menu on any of the tween scripts. It should probably be mentioned in the documentation. I only learned about it through watching the video tutorials.

5
NGUI 3 Support / Re: Placing button at corner using NGUI
« on: January 21, 2014, 10:08:46 PM »
It's easy with the new anchors system. Set the back button's anchor type to Advanced with the Left and Top targets set to the panel the button belongs to. Leave Right and Bottom blank. I would recommend watching the video on the UIRect documentation page.

6
NGUI 3 Support / Re: Custom mesh drawing in between GUI elements
« on: December 29, 2013, 03:46:43 PM »
It was posted in the Useful stuff thread I believe.

7
NGUI 3 Support / Re: UISlider web / pc version click goes wild
« on: December 15, 2013, 02:31:28 PM »
I've upgraded a very old project from NGUI 2.2 to 2.7 and then to latest in about 20 minutes. Since you're on 2.7 it's probably even less work so I'd suggest giving it a try. If it doesn't work just revert the changes. Aren's upgrade tool works great. Make sure to follow the upgrade instructions and drag your prefabs into a scene and run the upgrade script.

8
NGUI 3 Support / Re: Ngui as 2d game.
« on: December 04, 2013, 04:16:18 PM »
I've been using NGUI to create card games and it's worked quite well. I wouldn't use it for a game with a lot of moving/animating sprites though. The main advantage of using NGUI over the new 2D system is it's a unified way to combine sprites, labels (including embedded symbols), and input (UICamera) while reducing drawcalls. This was my thinking before UI2DSprite was added, however a mixture of UILabel and UI2DSprites would create a lot of drawcalls.

Neither system has a good way to adjust the depth a group of sprites such that no sprites can be drawn between them. Pushing a group of sprites to the front or back isn't always what you want, sometimes it needs to be just one depth ahead of another group of sprites. That feature would also be useful for games where the player character is composed of multiple sprites and walks in front or behind other characters.

9
NGUI 3 Support / Re: UIDragScrollView resets scrollView
« on: December 03, 2013, 07:11:28 PM »
Those changes also fixed the problem I encountered yesterday where scrollView wasn't set when adding a child using NGUITools.AddChild.

10
NGUI 3 Support / Re: Moving NGUI positions.
« on: December 03, 2013, 02:27:13 PM »
You want to use transform.localPosition instead of transform.position. UI Root is scaled down such that your UI isn't massive in your scene.

11
NGUI 3 Support / Re: NGUI 3.0.6 f7 pressing but moving to next button
« on: December 03, 2013, 02:18:28 PM »
Did not know about the new drag notifications. The <summary> at the top of UICamera.cs was updated but the online documentation wasn't.

12
NGUI 3 Support / Re: OnGui Equivalent To NGUI, "Displaying image"
« on: November 28, 2013, 02:28:56 PM »
I would recommend reading a book on C# or something to learn the language. Get and set mean mainTexture is a Property (a language feature) and both the get and set accessors are implemented. If you look at UITexture.cs you will see how it's implemented. In fact, whenever I'm not sure how something works I just read the source code. It's really easy to follow and is well written.


13
Sounds like pre-multiplied alpha was unchecked on the Atlas Manager. I noticed it when I updated NGUI recently. In the Atlas Maker window make sure PMA Shader is checked.

14
NGUI 3 Support / Re: OnGui Equivalent To NGUI, "Displaying image"
« on: November 28, 2013, 02:23:21 AM »
Read the class documentation too. You just need to set the mainTexture of the UITexture component to the one you loaded from Resources. You might need to call MakePixelPerfect after to adjust it's size or set it's with or height inherited from UIWidget. Here's some untested code.

  1. UITexture textureComponent = GetComponent<UITexture>();
  2. textureComponent.mainTexture = Resource.Load("texturename") as Texture;
  3. textureComponent.MakePixelPerfect();

15
NGUI 3 Support / Re: Could I upgrade from 2.6.5 to 3.0.6?
« on: November 25, 2013, 02:22:01 PM »
As long as you're using widget depth instead of adjusting the z-position it's fairly easy to upgrade a project. Just to be safe I'd recommend upgrading to 2.7 first and then to 3.0.6. Follow the upgrade notes and use the upgrade tool. I recently updated a large project that was released on the app store from 2.3 to latest in less than 10 minutes. Backup your project before you do and give it a try.

Pages: [1] 2