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

Pages: 1 [2] 3 4
16
NGUI 3 Support / Re: Referance atlas doesn't work as expected
« on: August 11, 2013, 08:02:47 AM »
NGUITools.Broadcast("MakePixelPerfect");
or call .MakePixelPerfect() on the object manually.

17
NGUI 3 Support / Re: Universal UI woes
« on: July 16, 2013, 02:53:21 AM »
I'm the developer of RetinaPro. I am working directly with Zophiel and hope to resolve his issue and, FWIW RetinaPro has been used in many applications without issue.

Apologies, Ian. I should rephrase that and add "I don't know how to properly use it". My biggest issue is simply all the UITextures, which setting the UIRoot to fixed doesn't fix because of the aspect ratio's of the resolutions. I guess my artist is hopelessly resigned to do a lot of different versions. I've been pretty persistent on trying to find a way to just use 1 atlas as I juuuust got the app under 50mb for 3g downloading, haha.

RetinaPro is in fact awesome at helping me organise the assets and handling the screen switching, don't misunderstand me :)

18
NGUI 3 Support / Universal UI woes
« on: July 15, 2013, 07:22:02 AM »
Hello,

I'm having some headache getting my UI ready for a Universal build. The UI was designed for non-retina iPads and the artist has some questions i cant really answer. He was hoping we'd be able to just scale the UI down and make it fit on other resolutions but that doesnt seem to do the trick nice enough as we have some pretty wide or high UItextures and they just get clipped.

The screenshot below is for 768 x 1024


How can i make this correctly fit the other resolutions? Do i need to tell the artist to produce assets for all the various sizes or is there a quick way to scale it all down? I do use anchors for positioning.

Below is a screenshot of the level selection, which uses a lot of UITextures as they are quite big.



I've bought and tried using RetinaPro but that requires a lot of assets to be made and does weird things with positioning.

19
Is the #if flag set through the atlas information from TexturePacker? the patch file looks pretty straight forward. Guess i should test in an empty project.

20
Sounds awesome. Can i apply the patch myself somehow or should i wait for an update?

21
Is there a specific reason why the custom packer doesnt rotate sprites?

22
I'm curious as well on what the status is on this? More so if i can use Texture Packer to generate my atlases and if so how do i import them for use with NGUI?

I'd love to use the rotate feature, it makes my textures oh so small!

23
NGUI 3 Support / Re: Spawning a sprite at a touch
« on: June 26, 2013, 09:59:49 AM »
Currently i got it working as follows by adding a collider in the area i want my sprites to spawn:

  1. Ray ray = UICamera.mainCamera.ScreenPointToRay( Input.mousePosition );
  2.                         RaycastHit rayHit;
  3.                         dropArea.Raycast( ray, out rayHit, 100 );
  4.                         GameObject decoration = (GameObject)Instantiate( selectedDecoration, rayHit.point, Quaternion.identity );
  5.                         decoration.transform.parent = mountPoint.transform;
  6.                         decoration.GetComponent<UISprite>().MakePixelPerfect();

Does anyone have any neater idea's?

24
NGUI 3 Support / Spawning a sprite at a touch
« on: June 26, 2013, 09:25:36 AM »
I've been going through search trying to find an answer but i think i dont understand what some of the data under UICamera.currentTouch is for. Right now I use the following which doesnt seem to get me what i need:

  1.                         Ray ray = UICamera.mainCamera.ScreenPointToRay( UICamera.currentTouch.pos );
  2.                         RaycastHit hit;
  3.                         Physics.Raycast( ray, out hit );

I have a center anchor point where I parent the widgets and then i need to set their localPosition to the touch position.

25
Awesome, thank you!

26
Hello,

I have several scroll views, all setup the same. I fill the grid dynamically with sprites and use .Reposition() when i'm done adding to sort them. Something happend recently in the project in some of the views that if you click in the view, the grid floats down a few pixels.

Without posting all the code, anyone have any inkling of an idea as to why? Grid cells are 150 x 200 and the sprite inside it is 88 x 88.

27
NGUI 3 Support / Consuming/waiting for new touch
« on: April 04, 2013, 07:02:04 PM »
Hello,

I've written a spell casting system. Pressing a button will set a spell's state to ready. The spell then waits for a touch phase ended to trigger. But pressing a NGUI button also sends that event to the spell casting it when you let go of the NGUi button.

What's the best way to handle something like this?

  1. void OnPress( bool isPressed )
  2.         {
  3.                 if(!isPressed) EquipmentManager.Instance.UseRune( runeIndex );
  4.         }

  1. override public void Use()
  2.         {
  3.                 if( isReadyToCast ) base.OnEffectCancel();
  4.                 else isReadyToCast = true;
  5.         }
  6.  
  7. override public void Update()
  8.         {
  9.                 if( isReadyToCast )
  10.                 {
  11.                         Debug.Log( "Ready!" );
  12.  
  13.                         if( Input.touchCount > 0 && Input.touches[ 0 ].phase == TouchPhase.Ended )
  14.                                 Debug.Log( "Cast Spell!" );
  15.                 }
  16.         }

28
Hello,

I updated my NGUI scripts through the asset store and I am now getting the following error after i stop playing a scene in the editor: Scene is being destroyed while there are hidden renderers that are using it. This is likely an editor script creating objects with hideFlags and leaving them enabled.

I've also set up 4 sprites, who's spriteName i change through code but for some mystical reason the old sprite doesnt seem to disappear anymore. Prior it would update fine.

[Edit] after some toggling some things on and off it almost looks as if NGUI is caching the graphics or something silly. I toggle off a huge part of the UI and then on play, as if by magic, that part of the ui shows up again. But i can't select it in the editor.

[Edit 2] Turning more things off and deleting things while running it left something like a cached image that i couldnt select. It was even there after deleting everything in the scene which led me to assume it was a Unity error of some kind. A quick restart seems to have cleared it up.

When in doubt, reboot.

29
NGUI 3 Support / Touches and Event System
« on: December 05, 2012, 05:36:17 PM »
Hello,

I've been reading several threads on the NGUI event system but i'm unsure how to set it up correctly with multi touches. If i got this right i need to at least attached an instance of UICamera to my main game camera. But how do i convert the following code to correctly use the NGUi events?

  1. //Touch and drag
  2. if (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Moved)
  3. //Pinch to zoom
  4. if (Input.touchCount > 1 && (Input.GetTouch(0).phase == TouchPhase.Moved || Input.GetTouch(1).phase == TouchPhase.Moved))

Reason being that when i press a button in my scene the camera reacts to it.

Cheers

30
NGUI 3 Support / Re: Grid with a lot of children crashes IOS Build
« on: December 04, 2012, 05:45:00 PM »
Well i just need the panels on the left and right to not show. It's not really what the designer had in mind.

Pages: 1 [2] 3 4