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

Pages: [1]
1
+1 Supporting rotated sprites in texture packer.

2
NGUI 3 Support / Texture Masks
« on: September 21, 2015, 12:55:46 PM »
Hello.
I was faced with a simple problem that can not decide.
I'm creating a training game. In certain areas it is necessary to make the dark while others leave the light.
https://yadi.sk/i/92ilCfEPjEMTG
I can of course each tutorial, make a texture size of the screen and leave it in the hole. And use Texture Mask on UIPanel
But these screens will be learning a couple of dozen. And you do not want to do for each texture size of 2048x1536.
I also have a situation where area that should remain is not darkened at a random location.

Ideally, I need to place multiple circles, and that everything around them was dark and bright inside them.

3
NGUI 3 Support / Optimize Big window in Atlas
« on: June 11, 2015, 07:43:34 AM »
Hello everyone!
For a long time I used sliced sprites to create a windows, inside of which was tailed texture.

But in the new project the artists have drawn a huge number of windows similar to this:
https://dl.dropboxusercontent.com/u/1210840/backPop.png
If I insert a sprite in the atlas, 90% of the size will occupy an empty space. What makes me very sad.

I see video http://www.youtube.com/watch?v=fyIpbMMUOFw This is the best solution for these windows\sprites?
I have a lot of similar windows of various shapes. And slice each window + add alpha-channel on borders.It takes a lot of time...

4
NGUI 3 Support / Re: UIButtonScale and Atlas Switching
« on: April 30, 2013, 12:36:19 AM »
wow ) cool feature )

5
NGUI 3 Support / UIButtonScale and Atlas Switching
« on: April 29, 2013, 10:13:04 AM »
I have a script similar to the http://www.tasharen.com/forum/index.php?topic=832
I have 3 atlases menu@1x menu@2x and menu@4x

I have testButton (by default uses menu@2x atlas)
testButton with UIButtonScale script (hover xyz=1.1 ) and background transform.scale x100 y100 z1 and sprite size 100x100

Problem is that when Atlas menu@2x is replaced by Atlas menu@4x sprite size change to 200x200 (background scale stay x100 y100)
But when UIButtonScale run -> background scale x200 y200
And the button is visually in 2 times more.

How to make that scale did not pay attention to the sprite size. and used only at are background transform.scale

6
NGUI 3 Support / Re: Resize background
« on: October 03, 2012, 07:11:03 AM »
thx. And then I thought that it was already implemented. and I'm just doing something wrong

Just one question how do I get the size of the sprite?(1140x760px)

7
NGUI 3 Support / Re: Resize background
« on: October 03, 2012, 03:44:47 AM »
Sorry pixel size is incorrect wording.
I say that if the aspect ratio of the image 11 to 7 after scaling it should stay the same. Just one of the axes will go beyond the scope of the camera.

8
NGUI 3 Support / Resize background
« on: October 03, 2012, 02:11:51 AM »
I have:
UIRoot automatic: off, manual h : 760
background 1140x760px added like sprite and attach UIStretch script

How to scale the image to the pixel size (aspect ratio) did not change?
Example:
Device 2280x760px: bg image scale*2 and cut the Y-axis
Device 1140x380px: bg image scale*2 and cut the X-axis





9
NGUI 3 Support / Re: Best Way to Save Slider Value
« on: September 23, 2012, 11:23:31 AM »
But thx I write:

  1. private var MusicSliderScript : UISlider;
  2. function Awake(){
  3.         MusicSliderScript = gameObject.GetComponent(UISlider);
  4.         MusicSliderScript.eventReceiver = gameObject;
  5. }
  6.  
  7. function OnSliderChange  (val : float) {
  8.         print ('chane '+val);
  9. }

10
NGUI 3 Support / Re: Best Way to Save Slider Value
« on: September 23, 2012, 10:07:49 AM »
I did not see because I use the free version NGUI.
If I understand it version 2.0.7c. A script UISoundVolume appeared only in 2.1.0?

11
NGUI 3 Support / Best Way to Save Slider Value
« on: September 21, 2012, 11:43:20 PM »
Я тут прочитал http://www.tasharen.com/forum/index.php?topic=1446.0 что можно по русски =) спросить.

Собственно переписываю самописный Гуй на NGUI возник вопрос с событиями.
У меня есть 2 слайдера один на Громкость музыки, второй на Громкость эффектов. Собственно как лучше сохранить информацию со Слайдера?
Т.е. теоретически я могу например написать скрипт вида:
  1. private var MusicSliderScript : UISlider;
  2. function Update(){
  3.         MusicSliderScript = gameObject.GetComponent(UISlider);
  4.         print(MusicSliderScript.sliderValue);  
  5.         // next save value
  6. }
Приатачить его к слайдеру. Но как то оно наверное не правильно? Опрашивать каждый Апдейт если можно реагировать на сами нажатия?
OnClick в слайдере нету, а но в коде я увидел OnDragThumb (),OnDrag () etc.
Правда когда я в своём скрипте сделал
  1. function OnDragThumb () {
  2.         print ('on drag');
  3. }
Она ни когда не срабатывала. Как лучше быть?

Pages: [1]