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

Pages: [1] 2 3 ... 6
1
NGUI 3 Support / HP Bar for monsters disappears at 10%
« on: July 13, 2014, 12:45:10 PM »
I have a Monster prefab with a section for name, hp bar, and level.  To get the health bar to show proper size I had to change the scale of the parent with the UISlider on it to .1/.1/1.0 scale so that I could leave the background and foreground sprites at their normal 50x8 size.

The problem with this is about 10% health the bar simply disappears I would assume because of the weird scaling.  I have a completely separate UI in the game that shows your party and normal scaling and all those health bars work as they should.. it's only these "world" objects I spawn in game which I have nested some UI into.

The parent for all the UI elements has a UIPanel on it... is something being done incorrectly here to cause the need to scale things very oddly?  I had to set the name and level for the monster to scale 1 also where normally it would be about 10.

Edit: I'm assuming the scale issue is due to not having the widgets under any kind of UIRoot? Not sure how to address it if so.. everything works fine in game if you simply toss widgets under normal GameObjects.. it just requires odd scaling.

Thanks.

2
NGUI 3 Support / Enter key works on disabled buttons..
« on: July 09, 2014, 09:45:04 AM »
I just got a bug report about being able to hit Enter to trigger buttons which was a huge surprise since I didn't code in the Enter button.  I went looking and found your submit and cancel key code... this could be useful but it all a sudden is making me rethink all the code I have in the entire game because I limit things by UI disables, not code (my fault I know).

The main problem I have with this is it allows hitting Enter for a button that is marked isEnabled=false.  Is there any way to prevent this from working on disabled objects?

3
NGUI 3 Support / Re: OnTooltip after clicking a button
« on: May 26, 2014, 01:59:09 PM »
This doesn't give exactly the intended result... is there any way to update and refresh the tooltip text without it calling a full rebuild of the tooltip and transitioning the size?

4
NGUI 3 Support / Re: OnTooltip after clicking a button
« on: May 26, 2014, 01:42:46 AM »
Was able to fix it with OnHover to give desired results.

  1.         private bool isMouseOver = false;
  2.  
  3.         void OnHover(bool isOver)
  4.         {
  5.                 // ignore if the mouse is already over - this happens since the OnHover event happens when the button is clicked
  6.                 if (isOver && isMouseOver) return;
  7.  
  8.                 if(isOver)
  9.                 {
  10.                         isMouseOver = true;
  11.  
  12.                         if(TrackedSkill == null)
  13.                                 return;
  14.  
  15.                         string tip = "[FF9900]" + TrackedSkill.skillName+ "[-]\n";
  16.                         tip += "[ffffff]" + TrackedSkill.tooltipDescription(false)+ "[-]";
  17.  
  18.                         if(TrackedSkill.OwnedRank < TrackedSkill.maxRanks)
  19.                         {
  20.                                 tip += "\n\n[cccccc]NEXT RANK[-]\n";
  21.                                 tip += "[FF9900]" + TrackedSkill.skillName+ "[-]\n";
  22.                                 tip += "[ffffff]" + TrackedSkill.tooltipDescription(true)+ "[-]";
  23.                         }
  24.  
  25.                         UITooltip.ShowText(tip);
  26.                         //return;
  27.                 }
  28.                 else
  29.                 {
  30.                         isMouseOver = false;
  31.                         UITooltip.ShowText(null);
  32.                 }
  33.         }
  34.  

5
NGUI 3 Support / OnTooltip after clicking a button
« on: May 24, 2014, 05:20:52 PM »
When using OnTooltip and clicking a button that has the script on it, the tooltip goes away and doesn't show back up.  I've got skill tooltips for an RPG using this system so I don't want the tooltip to go away at all while hovering the button.  Is there any way to make a tooltip not go away when clicking on a button?

6
NGUI 3 Support / Re: Fixed position UI Design
« on: April 20, 2014, 08:44:55 PM »
Ok so the max height is 244 which means no matter what we play the game at we'll be at 244 since 720p is the lowest res.. that part now makes sense.

390 is the width of 16:10 using 244 for the max height option on the UIRoot.

7
NGUI 3 Support / Fixed position UI Design
« on: April 20, 2014, 12:21:40 PM »
Going to open with this image from a game I saw...
http://media1.gameinformer.com/filestorage/CommunityServer.Components.SiteFiles/imagefeed/featured/red-hook/DarkestDungeon03.jpg

We had this same concept in mind when trying to design a bottom UI to our game where the world is above and the ui is below.  From the looks of it, do you need to design for 4:3 res which is your lowest ratio in order to make it compatible across all?

I know you could anchor and do some things to make a more modular design, but ours is very fixed just like theirs where any movement would cause it to not work.

So.. with our pixel game the UIRoot is man,min,max of 166 144 244 and I think this means literally nothing since the game runs at min 720p res, so technically we're at a fixed size?  Would it require fixedSize as the option to get something like this?

Here's a very rough sketch of the beginnings of ours where I've "blocked off" the sides to make sure we design within the 16:10 constraints since we're allowing widescreen only.  I'm just unsure what to tell our artist to design the UI in.  That's the main issue.  The image says 390x80 in the engine right now, so they just need to design to that spec?
http://i60.tinypic.com/65qq8g.png

Thanks in advance.

8
NGUI 3 Support / Use of Update() to track a party's info.
« on: April 19, 2014, 12:28:10 AM »
I'm wondering what the performance issues are if you use Update() on a class that you define say a public Party myParty which is simply a List<T> of members in your party.

Update would be updating the healthbar slider to always be up to date opposed to the current model I have of directly informing the party UI any time health is changed.  I tried using an event delegate system and wasn't happy with it, but it seems like there's some performance hits by updating widgets in Update like this.  Can you confirm that?

9
NGUI 3 Support / Re: More dynamic buttons?
« on: March 20, 2014, 11:29:19 PM »
In code or is this a new feature in 3.x that I can't get due to having problems upgrading our odd pixel art project to the new system?  Our UI is only 188px max height and font size is 10 when created in Glyph Designer, so the new font system snaps large adjustments any time the height is changed.

10
NGUI 3 Support / More dynamic buttons?
« on: March 19, 2014, 12:26:49 AM »
I'm trying to create a button system in the game where there's just a slight brightness on hover and the only good way I can see to do this is to tint all the buttons down to 200 200 200 255 as example and on hover do 255 255 255 255.  Is this the best solution since there's no way to do a complete image change on hover option?  I don't see any other way to do a highlight option like Diablo 3 where you're not really just going from color to color like you do in Starlink (which I assume you just have white buttons and adjust RGB in game).

11
NGUI 3 Support / Use UITooltip's screen bounds functionality?
« on: March 14, 2014, 03:19:48 PM »
Is there any help in how to go about taking say a custom Prefab with a set of widgets on it and utilizing the UITooltip's way of ensuring the pop up is confined within the game window and also at the spot that the mouse is when the tooltip is called?

The background for my item tooltip is always the same size because it's very custom like Diablo 3 with images etc, so I would think this would be easier than even your UITooltip system that dynamically changes the tooltip size based on contents.  Just not sure how to extract the pieces out that I need.

12
NGUI 3 Support / Re: Scroll View Lag?
« on: February 28, 2014, 03:30:28 PM »
That's kind of the problem... the UIInventory prefabs are pre-pooled into the system, it's not like I'm instantiating and destroying anything as they come in and out of the clipped area.  I don't see how you're supposed to take 100 inventory items the player owns and set a scrollable list unless you somehow only use 20 prefabs and on scrolll in and out of the clip you change what item the UIInventory prefab is pointing at.. which sounds a bit crazy.

13
NGUI 3 Support / Scroll View Lag?
« on: February 27, 2014, 08:22:55 PM »
This is potentially my fault due to poor design, but I have a scroll view that holds an inventory system.  The inventory can hold up to 100 items, so what Ive done is create 100 prefab instances that can contain all of the slots and the ones I don't need I make completely inactive.  When scrolling the list it lags horribly unless I delete all the way down to about 20 items.

Is there something with scroll lists that I might need to look for when containing a large number of prefabs within?

14
NGUI 3 Support / Handling Key input based on current open window?
« on: February 12, 2014, 12:15:25 PM »
How do you manage a complex UI where hitting 1 could mean execute skill 1 if you're in combat or it could also mean select party 1 if you're in a party menu?  I have a really complex UI game and I also need to get the focused window so that ESC closes out the most recently opened window, so I assume I'll have to add a hasFocus bool to my CloseWindow script that is checking for ESC and manage a List<> of all the windows that are open....

If there's an easier way I'd love to know.

15
NGUI 3 Support / Dynamic Localization Possible?
« on: February 03, 2014, 02:36:24 PM »
I have a game where the .text of labels is generated from a long string with several blanks and then the blanks are filled with random words chosen by a generator.

I also have many other strings in the game that are randomly generated based on what is going on at the time.

How do you create the localization file for something like this when there's no key/value pair which seems to be how the localization works?

Pages: [1] 2 3 ... 6