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

Pages: [1]
1
NGUI 3 Support / Creating Atlass from custom texture
« on: October 09, 2014, 12:11:04 PM »
Hello, Is it possible for me to create ngui atlass from custom texture?

That is I want to pack all my art myself in photoshop into one texture, then use ngui to slice it into buttons.
I want to slice it by hand.

Can I do this with ngui?
And if yes how?

Thanks in advance
(I would really prefer doing it this way for current project for many reasons).

2
NGUI 3 Support / Re: Change UISprite graphics on runtime
« on: August 03, 2014, 06:48:06 PM »
sprite name as a string?
and feed this string into UISprite?

3
NGUI 3 Support / Change UISprite graphics on runtime
« on: August 03, 2014, 04:26:19 PM »
Hi, I have sort of shop where I dynamically add items.
I have template NGUI prefab, where I insert string for name, level etc.

I also have sort of database of objects that should appear on shop. This is array of struct class and you just fill out it's child variables, and this data gets copied into NGUI shop template.

now this template also has icon field, icon is ngui sprite. So basically what I want to do is, to be able to set icon image in database, then insert this icon image into shop template. So when shop items are dynamically generated, each item has appropriate icon, name text, descr etc.

Now because ngui sprite has two field, Atlass and Sprite in Atlass, Like this

I have two problems here
1) I'm not sure how to add those Atlas/Sprite fields to my database(adding atlas/sprite as public variables in another class), so I can assign correct icon there
2) I'm not sure how to pass this variable into actual ngui sprite and thus change its icon image.

To sum up, I want to have array of blueprints, based on which I fill out data in template and thus build shop items at runtime.
And the problem I have is assigning icon variable in blueprint, and setting this variable in template.

as an alternative, I have done this with NGUI unity2D sprite, because here it's simple. sprite is just 1 variable, and you can pass it to another object easily, but this generates extra draw calls and I would rather use nguis own sprite.

Thanks and I hope I made some sense.

4
NGUI 3 Support / scrollview + keynavigation
« on: July 10, 2014, 06:00:47 PM »
hello,

I wanted to add keyboard and joystick navigation to my touch based menu.

Basically imagine something like a list of weapons that is generated inside a scrollview. you can scroll through this vertical list and buy or upgrade items.
You know sort of similar to this:
https://lh3.ggpht.com/Hq26HqtgxOsFF9PXIfEWF2aANw9DlgjTGOFQbK4rbpqVKkBWKN0_y7AD7bxRfyVCcw=h900

with keyboard this would work similar to console games interfaces, you navigate scrollview items with Up/Down keys. you hit down bottom item will get centered in scrollview and is now active.

the problem i ran into is how to tie the keynavigation to scrollview items?
how do I detect which inputs where clicked while button was selected? so I can have equip/upgrade options tied to separate joystick button?

5
NGUI 3 Support / How can I alter onPress and onClick functions?
« on: April 17, 2014, 08:57:02 PM »
Hey  :D

I was wondering if it is possible to alter button functions.
I'm building a simple joystick with gui and for arrows I want to simulate Input.GetButton behavior with NGUI-s OnPress, and it works, but the change I want to make is that now OnPress will set isDown to false only when you stop holding mouse or finger and I want it to set isDown to false when mouse or finger moves outside the button. So If I touch and hold my finger on arrow buttons and then move my finger (or mouse) completely off the button it is still "pressed" and I want to change this.

For OnClick it waits for you to sort of click and release to register clicking, sort of like ButtonUP, and I want for click to register during initial clicking like Unity's  ButtonDown.

If you could point me to where the script for this functions is within NGUI or if there is way to achieve my task without changing those any tips on that would be awesome too.

Thanks in advance!

Pages: [1]