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

Pages: [1]
1
NGUI 3 Support / Re: UI Drag Drop Item
« on: September 29, 2015, 06:29:54 PM »
 All right, thank you for the tips!
It did worked for me to Instantiate a Prefab right at the moment when UI-element leaves the UI panel, but I cannot get it work to continue dragging instantiated object? The new object doesn't receive a focus, I get that, but need some advice how to solve this problem.

 edited
btw, I'm using: NGUITools.Destroy(gameObject);
for the UI-element instead of alpha=0. I have a UI-container with 2 sprites in it, not sure how to change alpha for this one..

I have 'UIDragDropItem' script attached to UI-element and I call from here Instantiate function, which is in another script (Global manager):
  1. protected void OnDrag (Vector2 delta) {
  2.  ...
  3.  
  4.  if(UICamera.hoveredObject.name == ("hoveredBase"))
  5.   Manager.Instantiate...
  6.  
  7.  ...
  8. }
an instantiated object has its own 'onDrag' script.
My Main Camera is for the game objects, and UI Camera for NGUI, so.. if I understand it right, these two receive their own events? shall I do Raycast for the 'Main Camera' right after instantiation?

Would you be so kind and share some code example perhaps of how to switch from dragging of UI-element to that new instantiated game object? so I have one continuous drag movement. Thanks.

2
NGUI 3 Support / Re: UI Drag Drop Item
« on: September 21, 2015, 04:38:29 PM »
I believe I'm working on similar task.. what is the best way to simulate Drag and Drop solution like it is in Clash?

I want to Instantiate a Prefab in my 2D game when I Drag an Item/Sprite from the UIGrid (Clone on drag enabled), not immediately, but right
after Item leaves the UIpanel. I have 'UIDragDropItem' script attached to every Item in the Grid, and it should be different prefabs
instantiating corresponding to different Items.

Appreciate any help on this!

3
NGUI 3 Support / Re: Benefits of Atlas Switching
« on: August 07, 2015, 06:30:45 AM »
 Hi guys,
I'm not 100% sure if this is the right thread. There are several threads here and there about Multiresolution support, but still didn't help me, unfortunately..
I was trying diferent approaches to SD/HD Atlases switching in my game, but it didn't really worked as I expected.

I was wondering if I have, for instance, created two different NGUI sets - one for SD and another for HD, and simply enable/disable one of those via script, based on Device resolution (width or height) , will it have any impact on memory?
I have two Atlases: SD and HD, but not loading them from Resources. Two GUI sets just using corresponding Atlas, that's it.

I'd like to have crispy (Pixelperfect) GUI for SD and HD.


Also, is there any restrictions or recommendations regarding how many Atlases one can use in a game?
Appreciate any tips!

4
 I'm trying to make this effect in my game using NGUI:
-Player clicks a Button (buy something or trade)
-Panel is activated and Label/message shows up -> popup
-Panel has two Tweens attached: position and alpha

This works fine when I use such approach for popup windows, where there is a 'Close button' inside window that resets Tweens and disables Panel/Item. 'Close button' has "UIButtonActivate" script attached.

But I cannot make it work in similar way without button/Onclick event: I'm trying to disable Item and reset Tweens via script.
I need to deactivate and reset everything after a few seconds via script, otherwise Tweens are not repeating, of course.

What is the right way to do that?
wondering if there is a solution similar to UIButtonActivate script, but without onClick? after Tweening is done

5
 Ok, I think I found the solution and solved my problem!  :D
Probably it's silly, but I forgot to use Anchor (legacy) in NGUI 3.6 since it creates only UI Root + Camera.
And now I can use Pixel-perfect, of course. Hope this helps to someone with similar issue.

Now everything looks crystal clear and sharp! Thanks again for this cool Asset.

6
I tried different resolutions, one I work with at the moment 960x640. And yes, I've done "ALT+SHIFT+P" part, but this operation makes sprites and labels look blurry. As I understand this sets all images to their default size and its not pixel-perfect for some reason (neither in editor or exported).

As I explained before, I'm using exactly the same images and it does look fine if I test with the same Editor resolution, but NGUI 2.7
This is very odd must say..

7
For some reason Sprites and Labels after migrating NGUI from 2.7 to 3.6 are not as sharp and clear as before? 
Tried many things, but quality is still not as good as I created with 2.7 (the same images and fonts)

This is what I tried (working with Unity 4.5.2 free version):
-imported into empty project NGUI 2.7 - looks perfect! sharp quality of sprites and labels.

-tried importing NGUI 3.6 in empty project - no matte what I do, all sprites and labels are slightly blurry,
the only thing that improves the situation was to scale down a bit every sprite and labels, but still
not pixel-perfect as it should be and as it was with 2.7; UIRoot has 'PixelPerfect' as scaling style

Wondering what am I missing?
Anyone knows what could be the problem and how to fix it? Would be really great, appreciate it!

Pages: [1]