Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: sawada on April 07, 2014, 11:40:46 AM

Title: how select UISprite Flip in code
Post by: sawada on April 07, 2014, 11:40:46 AM
As title.

change UISprite Flip use Inspector is easy.
select Flip Type Nothing,Horizontally,Vertically and Both.

but,donot select Flip ins code.


//example. change Sprite is ok
this.ui_sprite.spriteName = set_sprite_name;
//but error all
this.ui_sprite.Flip = 1; //??
this.ui_sprite.mFlip = Flip.Horizontally; //??
this.ui_sprite.FlipType= Flip.Horizontally; //??


i lock this.but I did not know
http://www.tasharen.com/ngui/docs/class_u_i_sprite.html

What should I do >:(
Title: Re: how select UISprite Flip in code
Post by: ArenMook on April 07, 2014, 10:37:33 PM
Good catch. Add this function to UISprite:
  1.         /// <summary>
  2.         /// Sprite flip setting.
  3.         /// </summary>
  4.  
  5.         public Flip flip
  6.         {
  7.                 get
  8.                 {
  9.                         return mFlip;
  10.                 }
  11.                 set
  12.                 {
  13.                         if (mFlip != value)
  14.                         {
  15.                                 mFlip = value;
  16.                                 MarkAsChanged();
  17.                         }
  18.                 }
  19.         }
Title: Re: how select UISprite Flip in code
Post by: sawada on April 20, 2014, 01:03:54 AM
I am sorry for the delay in my response.
i try it and succes it.
thanks a lot