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 - kamil.slawicki

Pages: [1]
1
NGUI 3 Support / Irregular Shape UIWidget?
« on: January 20, 2014, 11:37:15 AM »
Hi there.

I am writing an extension tool for NGUI that will let you manipulate the four corners of the widget in order to make quadrilateral widgets of any shape. I am making a new widget type deriving from UIWidget.  I would like to know if there is any sort of callback that would let me know that the pivot of a widget has changed. I noticed that all the processing is done inside the pivot property. What I need to do is to change the position of the vertexes that describe the mesh so they would match the new pivot point. I would like to get the tool working without altering NGUI source code. Any information would be much appreciated. Thanks.

2
NGUI 3 Support / Re: Sprite information in UV space?
« on: December 20, 2013, 12:00:13 PM »
We are setting textures for particle systems to use the same texture as a sprite.

  1. IconMaterial.mainTexture = IconSprite.mainTexture; // load the texture used by the sprite
  2. IconMaterial.mainTextureOffset = new Vector2((float)IconSprite.GetAtlasSprite().x / IconSprite.mainTexture.width, 1 - (float)IconSprite.GetAtlasSprite().y / IconSprite.mainTexture.height - (float)IconSprite.GetAtlasSprite().height / IconSprite.mainTexture.height); // set UVs of that particular icon
  3. IconMaterial.mainTextureScale = new Vector2((float)IconSprite.GetAtlasSprite().width / IconSprite.mainTexture.width, (float)IconSprite.GetAtlasSprite().height / IconSprite.mainTexture.height); // same here
  4.  

I was just testing stuff a second ago so forgive my poor formatting. I was thinking to make an extension method for UISprite that returns a Vector2 for x,y and another one for width,height.

3
NGUI 3 Support / Sprite information in UV space?
« on: December 20, 2013, 11:08:23 AM »
Hi there.

Is there a way to get sprite's x, y, width and height in uv coords rather than pixels? I know I can divide by the atlas texture width/height but I was hoping there was a built in way to do that. I recently converted from 2.x to 3.x and it looks like this stuff has been dropped.

Thanks.

4
NGUI 3 Support / Re: SetAsToggleButton() in 3.x
« on: December 17, 2013, 10:18:16 AM »
Thanks for a quick answer.
Is this a regression when comparing to 2.x?
Is it still possible to use the ImageButton to do this?
The reason I'm asking is so the designers can still use the editor to specify the sprites they want to use for each state.

5
NGUI 3 Support / SetAsToggleButton() in 3.x
« on: December 17, 2013, 08:22:28 AM »
Hi there.

I've recently upgraded to 3.x release, I'm on 3.0.7 f3 at the moment. I would like to know what is the new way of implementing SetAsToggleButton() of UIImageButton class. I have tried to search the forum but was unable to find the answer I was looking for.

what I have is a toggle button sprite that works sort of like so:

on state:

[O  ]

off state:

[  O]

Thanks.

6
NGUI 3 Support / Interactive world space ui elements.
« on: December 13, 2012, 01:18:53 PM »
Hi there,


I would like to know if it is possible to have a piece of UI created with NGUI that is floating somewhere in the world but can be interacted with by using the mouse. The case scenario here is having those door terminals that would show a numeric key pad floating above them and the user is able to use the mouse in order to press some buttons and unlock the door.

Cheers.

Pages: [1]