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

Pages: 1 2 3 [4] 5
46
Support / Re: Problem with setting up UI.
« on: January 20, 2014, 10:58:59 pm »
Code: [Select]
No. While you could do that, I wouldn't recommend it if you were building a GUI app as you'd litter your codebase with lots of little not particularly modular scripts. IMO, the way the demo scenes are set up are a much much better way - i.e. you would have a controller script with public tk2dUIItems, then drag & drop a reference into the slot in the inspector. We usually build one controller per "dialog box / screen", as its usually specific code anyway.
[/quote]

Thanks, would you please show me a scene that you used this method so I can see it in action?

The only scene I see related to UI is 6 - button and 3d sprites and in that I don't find these new stuff and I believe it's deprecated.

47
Support / Re: Problem with setting up UI.
« on: January 20, 2014, 05:08:06 pm »
1. That is a remnant from an old tutorial. That step is no longer required. I've updated that now.

Noted, thanks!

2. All interactive elements in tk2d UI have a tk2dUIItem component attached to them. The example shows shows how you'd subscribe to and unsubscribe form the event - there are many ways to get the reference to the object in Unity. The most common is to create a public variable and dragging a reference to it. Thats how all the demos work. You would probably put it into your ui controller script to handle all the rest of the UI.

I'm sorry but I still do not understand how to do set up for a simple button and attach those delegates I posted before.

What is "uiItem" ? Is it "tk2dUIItem" component attached to the current button? So I have to create a C# script, attach it to the button and use GetComponent<tk2dUIItem>() on it and assing it uiItem in it's like Awake call?

Should add a tk2dUIManager as well to each scene?

Out of curiosity what would you expect in the tutorial? The tutorials right now target those that know how things work in Unity and only show things that are specific to tk2d. We could go much more in depth of course, but that would reduce the amount of time we'd have to work on updates / provide support / etc. The reason I ask is so I can further optimise the balance, depending on our users needs.

I'm well familiar with Unity. But as someone new to tk2d, I have some recommendations:

1- Make quick video tutorials rather than text based ones.

Honestly, I learned a lot by user created tutorials of tk2d rather than your whack-a-mole tutorial. I suggest you just do quick (mostly 15min) tutorials for basic stuff to get people, like me, started and from then on we can tag along since I believe you have a similar architecture for the UI components and if one learns how to work with button, I think they can easily transfer that knowledge to other components as well.

I believe you can safely assume that the audience has a basic Unity understanding and skip anything on the Unity side. OK, maybe a little on stuff like delegates and events but focus on tk2d.

I see that people, mostly my students, are interested in video tutorials rather than text based ones. But then again, some things are better be in text format so you can re-read them but it's up to you.

I personally think it's easier to do video tutorial rather than typing.

(Also you never finished the whack-a-mole tutorial! I checked it several times so far with high hopes and crossed fingers ...)

2- Other than that, I think you need some clean and simple scenes. I loved your demo scenes but could not learn much from them because from my understanding, they were created for the demo purposes and lacked the engineering that a real world game requires.

Maybe you can have two sets of demo scenes, one to show the awesome features you have and another just to show how to use the components. We use Unity and tk2d to get up and running fast, right? ;)

3- Update your tutorials when you edit something that breaks compatibility and hence renders older tutorials useless.

48
Support / Re: Problem with setting up UI.
« on: January 19, 2014, 04:31:56 pm »
Hi,

In the documentation page I posted, http://www.2dtoolkit.com/docs/latest/ui/customizing_button.html, the first number is to: "Follow instructions in 'Setting up UI' tutorial." and I can't find it anywhere.

2- Also in this fie: http://www.2dtoolkit.com/docs/latest/ui/system.html it says that to listen to events I should use this code:

Code: [Select]
void OnEnable()
{
    uiItem.OnDown += ButtonDown;
    uiItem.OnClickUIItem += Clicked;
}

void ButtonDown()
{
    Debug.Log("Button Down");
}

void Clicked(tk2dUIItem clickedUIItem)
{
    Debug.Log("Clicked:" + clickedUIItem);
}

//Also remember if you are adding event listeners to events you need to also remove them:
void OnDisable()
{
    uiItem.OnDown -= ButtonDown;
    uiItem.OnClickUIItem -= Clicked;
}

But first of all, what is uiItem? Should I make an empty C# script, put this code inside it and attach it to my button?

Wish there was a simple tutorial on how to make these from ground up. I tried to understand it via demo scenes but had no luck.

Thanks.

49
Support / How to have a progress bar.
« on: January 18, 2014, 03:32:50 pm »
Hi,

I was wondering what's the fastest way to have a progress bar in tk2d. Also I wan it to have a background or something so user can easily identify how much of the progress bar is currently filled.

Just found the progress bar prefab but two questions:

1- What are bare essentials to use UI elements like buttons or this progress bar?

2- Buttons and most UI elements ar eunder 2k2dUI_demo folder. Why it says demo? Does it mean we can't use them in

3- What's the best way to find and alter value of progress bar? For example, one game objects decides to change value of progress bar or progress bar needs to monitor value that it will show from another game object's value. What method do you suggest?

Thanks.

50
Support / Problem with setting up UI.
« on: January 18, 2014, 03:26:45 pm »
Hi,

In various parts of the UI documentation, you refer to "Setting up UI" but I can't find it (like here: http://www.2dtoolkit.com/docs/latest/ui/customizing_button.html). I could put a BasicButton on the scene but don't know how to attach the behavior from the documentation to it.

I really wish there was a complete tutorial for UI as I see there are some advance stuff there but can't get my head around them.

Thanks.

51
Support / Re: Is there anyway to import sprite sheets?
« on: January 09, 2014, 11:04:31 am »
You are a genius.

52
Support / Re: Pixel Per Meter question.
« on: December 30, 2013, 07:52:17 pm »
Thanks, that solved it, totally forgot to set PPM in sprite collection.

But that brings two more questions:

1- What should I put in PPM? What's the "correct" number? I'm sure there is no "correct" number, actually interested to know what should one set for PPM and what are parameters important to set PPM.

2- How PPM is related to different resolutions of different art assets (1x, 2x, 4x, etc). Is PPM have the same value across different resolutions so if you double your art assets, then PPM still the same? I think it does, just asking to make sure it is.

Thanks.

53
Support / Re: Is there anyway to import sprite sheets?
« on: December 30, 2013, 06:50:43 pm »
Thanks for the super quick reply.

Sprite sheets are not irregularly shaped, quite the opposite, they are collection of sprites that are exactly the same size. For example a file that is 450x100 has 10 of 45x100 sprites sitting next to each other in an image. What about now, can I import them somehow into tk2d?

54
Support / Anchors question.
« on: December 30, 2013, 03:19:18 pm »
Hi,

I've read the documentation but could not understand their purpose. Are they for moving a sprite so you would know where they start moving from? Are they for multi-resolution swapping?

A brief description is much appreciated!

Thanks.

55
Support / Pixel Per Meter question.
« on: December 30, 2013, 03:12:28 pm »
Hi,

I've read the documentation and I, at least think, know what it means but have no idea what I have to set for my game. For example, I set my tk2dCamera's native resolution to 320x480 and loaded some sprites that should take half of the stage but they seemed smaller. I increased PPM and it looked somewhat similar but still not the same.

What setting should I set in my tk2dcamera if I want to see exact size of sprite that I see in like Photoshop?

Thanks.

56
Support / Is there anyway to import sprite sheets?
« on: December 30, 2013, 03:08:53 pm »
Hi,

I'm porting a game to 2D Toolkit and my art assets are already in sprite sheets. Is there any way to import them to 2D Toolkit and not make each sprite of that sprite sheet into separate sprite file?

If not, do you a way to automate this via a program? Because I have a fairly large amount of sprite sheets and it's unhuman to ask my artist to do it!

Thanks!

57
Support / Re: How to have a draggable object with 2D toolkit?
« on: December 18, 2013, 10:18:20 pm »
Thanks, that did it.

Would you please help me with the number 3, the sum of movement behavior?

58
Support / Re: How to have a draggable object with 2D toolkit?
« on: December 15, 2013, 04:06:25 pm »
1) Thanks but I still cannot get it to work.

Here is what I've done:

Created a quad, removed it's collider and added a Box Collider 2D to it, added Tk 2D UI camera to my main camera, added a UI Manager (from 2k td), added Tk 2D UI Item and Tk 2D UIDrag Item to my quad , in the UI Manager I selected my camera (that has the tk 2d UI camera script attached to it)

What am I missing?

BTW, I was testing with mouse, but I think it should work, right?

Thanks.

EDIT


I found the problem, apparently TK 2D doesn't work with 2D colliders and when I reverted back to Box Collider, it worked. Please do correct me if I'm wrong.

Thanks

2) is this a good idea to have this in my game when there are like more than 30 of draggable objects that move accross the screen at a time? I'm asking because it's named "UI" and I wonder if it has any considerable overhead that is not advisable to be treated as a regular draggable object for heavy lifting.

3) When my object gets touched, can I catch an event or message so I can handle some game logic with it? For example in my game these draggable objects are moving constantly and when you touch them, they have to stop and in order to detect that, I have to know when TK 2D detects a touch on them that I can catch as well.

3) Can I get the vector or direction that my obeject was getting dragged? In my game, when player draggs and releases the draggable object, I want my object to move along the direction that it was getting dragged, as like it's getting thrown in 2D.

Thanks again.

59
Support / Re: How to integrate MultiPlatform Toolkit with 2D Toolkit.
« on: December 04, 2013, 01:55:36 am »
Yep, I've read that it works but I don't know how to make these work together.

60
But it's quite possible to handle situations that most people want for mobile. I mean engines such as Corona SDK do it and there are some Unity assets that do it as well and it's really strange, at least to me, to see that tk2d doesn't support such feature.

Pages: 1 2 3 [4] 5