Hello Guest

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

Pages: [1]
1
Support / AudioListener.volume
« on: November 11, 2013, 10:42:43 am »
Apparently we need to update "tk2dAudioManager.cs" at line 65:

Code: [Select]
audioSrc.PlayOneShot(clip);
to:

Code: [Select]
audioSrc.PlayOneShot(clip, AudioListener.volume);
The reason I found this issue was I noticed that the volume of sounds on a button click (tk2dUISoundItem)  were not adjusting properly with my volume slider, even though the AudioListener.volume was changing. Found the fix via this link:

http://forum.unity3d.com/threads/192150-In-Unity-4-2-the-AudioSource-PlayOneTime-is-ignoring-AudioListener-volume

2
Support / Re: Anchoring viewport clipping not allowed on this camera.
« on: November 04, 2013, 03:37:06 pm »
I got it working yeah. The anchor works fine it was just multiplying the valule of my offset by the orthographic value of the camera, so it was appearing 5xTimes as far into the corner as I wanted it to. Fixed now, onto the next thing ;)

3
Support / Re: Anchoring viewport clipping not allowed on this camera.
« on: November 03, 2013, 10:47:09 pm »
We need to anchor a button to the top-right corner of an existing unity-camera... I had it set up as I do in other scenes, and it seems to work fine, except the button is waaaay off where it should be.

This error is quite possibly nothing to do with it, other than it talks about anchoring?

4
Support / Anchoring viewport clipping not allowed on this camera.
« on: November 02, 2013, 10:40:01 pm »
V: 2.2.3


Why would this error occur?

5
Support / Re: runtime container resizing
« on: October 30, 2013, 11:01:35 am »
That's just it... I don't know how to set the width/height to the screen extents, would it be something like this:

windowLayout.Set(tk2dCamera.Instance.ScreenExtents.xMin, tk2dCamera.Instance.ScreenExtents.yMin, 0)
windowLayout.Set(tk2dCamera.Instance.ScreenExtents.xMax, tk2dCamera.Instance.ScreenExtents.yMax, 0)

??

6
Support / Re: runtime container resizing
« on: October 30, 2013, 10:45:19 am »
Ok I've taken the code which resizes the window (minus the tweening and the nextButton - which isn't needed) and I'm left with:

Quote
public class GUI_Resizer : MonoBehaviour {

   public tk2dUILayout windowLayout;

   Vector3[] rectMin = new Vector3[] {
      Vector3.zero,
      new Vector3(-1.0f, -1.0f, 0),
      Vector3.zero,
   };
   Vector3[] rectMax = new Vector3[] {
      Vector3.one,
      new Vector3(1.0f, 1.0f, 0),
      Vector3.one,
   };
   int currRect = 0;

   void Start() {
      // Read the current window bounds
      rectMin[0] = windowLayout.GetMinBounds();
      rectMax[0] = windowLayout.GetMaxBounds();
   }

   void LateUpdate() {
      // Get screen extents      
      int last = rectMin.Length - 1;
      rectMin[last].Set(tk2dCamera.Instance.ScreenExtents.xMin, tk2dCamera.Instance.ScreenExtents.yMin, 0);
      rectMax[last].Set(tk2dCamera.Instance.ScreenExtents.xMax, tk2dCamera.Instance.ScreenExtents.yMax, 0);
   }
}

It should be simple enough to set the size of 'windowLayout' to be the ScreenExtents.... How do I do that? Does it need to be during an Update method?

7
Support / runtime container resizing
« on: October 30, 2013, 09:25:32 am »
Version: 2.2.3

I have a set of objects, held within a UI Container Sizer placed in the middle of a screen with ratio 5:3.

When I change the aspect ratio to something else (say: 3:2) the width of the screen increases but the Container Sizer does not (despite having dynamic objects inside it).

Do you think it would be possible to modify the UI Container Sizer script to resize itself to the width/height (or both?) of the screen?

8
Support / Re: UI Advanced Paging
« on: October 26, 2013, 11:11:13 am »
I realize I am perhaps addressing two issues at once so apologies for that.

For the sake of reaching a conclusion, I believe it may be easier to look at the hierarchical setup first and then to address the script/code.

My question is this:

If we take the DemoScene (that comes with a fresh install of 2dtk), and we wanted to have the initial window anchored to the camera, what would be the best way of achieving this?

9
Support / Re: UI Advanced Paging
« on: October 25, 2013, 05:04:25 pm »
For a simpler example,

Take the UI Demo file.... where would you add an anchor to get the first window linked to the camera?

10
Support / Re: Button Colour on event?
« on: October 25, 2013, 04:07:17 pm »
Works well, thanks!

11
Support / UI Advanced Paging
« on: October 25, 2013, 03:46:48 pm »
Using Version: 2.2.3

What is the best set up for a main menu that shows/hides various windows when specific menu options are chosen?

The criteria is that the main menu MUST be anchored to the Top Left side of the screen, for this anchors are used but it seems that disabling/enabling windows causes any transforms to be applied to all the children inside an object. My current hierarchy is shown below, is there a better way given that I may end up with multiple windows and buttons?

GUI_code (an empty game object with a single controller script.)
Camera (regular camera with 'tk2dUICamera' script attached.)
     Anchor (UpperLeft)
          Window_A
              button
              button
     Anchor (MiddleCentre)
          Window_B
              button
          Window_C
              button

The script is for the most part a copy of the UIDemoController script, which allows users to define gameobjects and a prev/next button. In this case I ahve 2 windows but for the sake of making it work I am only using Window_A and Window_B, the buttons in each window are used as the prev/next controls.

12
Support / Re: Button Colour on event?
« on: October 25, 2013, 02:46:44 pm »
Yes, as I copied the original button graphic that came with the demo Button and just renamed it. The whole thing is held inside the Camera... as that seems to be the only way Anchors work:

Camera
   Anchor
      BasicButton <--- script is held in here
          SlicedSprite_up
             text
          SlicedSprite_down
             text

I'm surprised this hasn't come up as an issue before, considering a button rollover is such a common thing to have in UI's. In the past I used the nGUI plugin which had similar problems showing/hiding objects in Unity (in soem cases it wouldn't work at all) so I'm dubious as to whether 2dTK is actually to blame here. Truth be told, it does work fine, it's just that those errors could be a problem on some devices when the game is released, so I'd like to deal with them now if possible.

13
Support / Re: Button Colour on event?
« on: October 25, 2013, 12:56:42 pm »
The script is attached to the parent object (in this case BasicButton.)

like this:

BasicButton <--- script is held in here
    SlicedSprite_up
        text
    SlicedSprite_down
        text

14
Support / Re: Button Colour on event?
« on: October 25, 2013, 11:00:17 am »
I've gotten it working, but there seems to be an error when the button is pressed at runtime.

Quote
Coroutine couldn't be started because the game object 'ButtonGraphic_down' is inactive!

In this case, I have two sprites setup for each state of the button... ButtonGraphic_down is just the sprite for when the button is pressed.

I'm using UIUpDownButton as no hover is needed.

Any ideas why the error might be occurring?

15
Support / Button Colour on event?
« on: October 22, 2013, 09:35:13 am »
Greetings and apologies if this is already answered elsewhere in the forums.

As of now I am now using 2.2.3 - up to date, verified integrity.

What is the best method for changing the colour of a button sprite on an event (i.e. MouseDown)? Or at least swapping out the sprite with another one duging the event...

Thanks,

BC

Pages: [1]