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 - gary-unikronsoftware

Pages: 1 2 3 [4]
46
Support / Re: Whack-a-mole tutorial dust animation position
« on: July 25, 2013, 08:47:59 am »
We have added a link on the tutorial where you can download our package for the tutorial and compare yours against it to see if you can spot the difference.  You can get it from here: http://www.2dtoolkit.com/docs_extras/wam_tutorial21/RestOfGame_Complete.unitypackage .  Or feel free to create an export package of your project and send it to our support email and I'll have a look at it for you.

Thanks.

47
Support / Re: Whack-a-mole tutorial dust animation position
« on: July 24, 2013, 12:43:23 pm »
Re-reading your post... when you say the animation is down and to the left, do you mean it is 'down and to the left' of the mole that you hit, or it is in the bottom left of the game screen all of the time?  If it's the former, also check the anchor position on the Mole sprites as well, which I've used middle-center for mine.  If the animation is the bottom left of the screen all of the time, have you added the MainGame script to the scene?

48
Support / Re: Whack-a-mole tutorial dust animation position
« on: July 24, 2013, 09:21:09 am »
Hi,

It sounds like the anchor on the dust sprites is in the incorrect position.  In the Project window, select the Dust Sprite Collection then click on the Open Editor button in the Inspector window.  When the sprite collection window opens, select one of the sprites - the Anchor should be set to 'Middle Center' so if it isn't change it to that.  You can multi select all of the sprites and change the anchor on all of them at once.  Remember to commit your changes!

49
Hi Wrecker,

After you have created your sprite collection in the project window, edit it from there to add your sprites rather than dragging it to the Hierarchy window.  Also when you are creating your sprite animation do it from the project window rather than the hierarchy window.  The new Whack-a-Mole tutorial contains step-by-step instructions on creating a sprite collection http://www.unikronsoftware.com/2dtoolkit/docs/2.10/tutorial/whack_a_mole/game_objects.html and also sprite animations http://www.unikronsoftware.com/2dtoolkit/docs/2.10/tutorial/whack_a_mole/rest_of_game.html.  Hope this helps.

50
Support / Re: Inconsistent firing for UIItem
« on: July 22, 2013, 10:41:48 am »
Hi,

If you are using an OnEnable() function on your buttons, you should also have a corresponding OnDisable(), i.e.

void OnDisable()
{
     button.OnClick -= pickTeam;
}

Try that and see if it fixes some of your issues.

51
Support / Re: Detecting Sprite touches
« on: July 20, 2013, 09:45:14 pm »
Select your camera in the Hierarchy window.  In the inspector window just underneath the name of the camera there should be a field called 'Tag' with a drop-down box next to it.  Is this set to 'MainCamera'?  If not, select MainCamera from the drop-down box and see if that fixes it.

52
Support / Re: How can i create HUD movement buttons?
« on: July 20, 2013, 09:20:43 am »
Hi,

Yes you will need a UIManager in order for the tk2d buttons to work: In the hierarchy window select 'Create > tk2d > UI Manager'.  Once it's created, select it in the hierarchy window then drag your scene camera onto the 'UI Camera' slot in the Inspector window.

tk2d provides a number of different button and UI prefabs which can be found in 'Project > TK2DROOT > tk2dUI_demo > ControlPrefabs'.  Drag the BasicButton prefab into your hierarchy window and select it.  If you expand the button object, the ButtonGraphic will let you select one of the existing sprites from the default UIDemoSpriteCollection, or you can use a sprite from another collection.  You may need to scale the size of the button sprite up depending on your camera settings.  If you do change the scale of the button graphic, remember to click on 'Fit' in 'Tk 2d UIItem > Collider > Automatic Fit' to ensure the collider is the same size as your button.

Finally, you can drag a game object that contains a script onto 'Send Message > Target', which will then allow you to select which functions are called depending on the state of the button e.g. 'On Click', On Up' etc.  e.g. If you have an arrow pointing right as your button graphic, you might link this to a function 'MoveRight' when the button is clicked.

I hope this clarifies things for you.

Thanks.


53
Hi,

If you haven't already, click on the 'Fit' button under 'Tk 2d UIItem > Collider > Automatic Fit' which should set the collider size to the same size of the button.

If this doesn't work, it may be the collider for the button is largely 'behind' another object or collider, try moving the button to a different area of the screen to see if that detects it.  Or it may be that the button's sprite also has a collider enabled on it, which is eclipsing most of the collider on the UIItem.  If that's the case then disable the sprite's collider.

If none of that works, can you post a screen shot with the UIItem button in scene mode?

Thanks.

54
Support / Re: How can i create HUD movement buttons?
« on: July 19, 2013, 09:59:05 am »
Hi Rukasu,

You can do it either way, just by using a regular sprite and writing behaviour code for it, or by using a Tk2d UIItem button.  However, by using the button you can easily attach your own sprite to it, PLUS you get all of the button's in-built functionality for detecting presses and sending messages to other parts of the game, so a lot of the 'hard work' is already done for you.

In the tk2d toolkit 2.1 update (coming soon), it makes it even easier to define button behaviour.

Hope this helps.

Pages: 1 2 3 [4]