static int Tint(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { FairyGUI.ColorFilter obj = (FairyGUI.ColorFilter)ToLua.CheckObject <FairyGUI.ColorFilter>(L, 1); UnityEngine.Color arg0 = ToLua.ToColor(L, 2); obj.Tint(arg0); return(0); } else if (count == 3) { FairyGUI.ColorFilter obj = (FairyGUI.ColorFilter)ToLua.CheckObject <FairyGUI.ColorFilter>(L, 1); UnityEngine.Color arg0 = ToLua.ToColor(L, 2); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); obj.Tint(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.ColorFilter.Tint")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int get_target(IntPtr l) { try { FairyGUI.ColorFilter self = (FairyGUI.ColorFilter)checkSelf(l); pushValue(l, true); pushValue(l, self.target); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int Invert(IntPtr l) { try { FairyGUI.ColorFilter self = (FairyGUI.ColorFilter)checkSelf(l); self.Invert(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int constructor(IntPtr l) { try { FairyGUI.ColorFilter o; o = new FairyGUI.ColorFilter(); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } }
static int Invert(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); FairyGUI.ColorFilter obj = (FairyGUI.ColorFilter)ToLua.CheckObject <FairyGUI.ColorFilter>(L, 1); obj.Invert(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int set_target(IntPtr l) { try { FairyGUI.ColorFilter self = (FairyGUI.ColorFilter)checkSelf(l); FairyGUI.DisplayObject v; checkType(l, 2, out v); self.target = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int ConcatValues(IntPtr l) { try { FairyGUI.ColorFilter self = (FairyGUI.ColorFilter)checkSelf(l); System.Single[] a1; checkParams(l, 2, out a1); self.ConcatValues(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int AdjustBrightness(IntPtr l) { try { FairyGUI.ColorFilter self = (FairyGUI.ColorFilter)checkSelf(l); System.Single a1; checkType(l, 2, out a1); self.AdjustBrightness(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int ConcatValues(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); FairyGUI.ColorFilter obj = (FairyGUI.ColorFilter)ToLua.CheckObject <FairyGUI.ColorFilter>(L, 1); float[] arg0 = ToLua.CheckParamsNumber <float>(L, 2, count - 1); obj.ConcatValues(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int AdjustSaturation(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.ColorFilter obj = (FairyGUI.ColorFilter)ToLua.CheckObject <FairyGUI.ColorFilter>(L, 1); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.AdjustSaturation(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int Tint(IntPtr l) { try { FairyGUI.ColorFilter self = (FairyGUI.ColorFilter)checkSelf(l); UnityEngine.Color a1; checkType(l, 2, out a1); System.Single a2; checkType(l, 3, out a2); self.Tint(a1, a2); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int get_target(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.ColorFilter obj = (FairyGUI.ColorFilter)o; FairyGUI.DisplayObject ret = obj.target; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index target on a nil value")); } }
static int set_target(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.ColorFilter obj = (FairyGUI.ColorFilter)o; FairyGUI.DisplayObject arg0 = (FairyGUI.DisplayObject)ToLua.CheckObject <FairyGUI.DisplayObject>(L, 2); obj.target = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index target on a nil value")); } }
static int GetColorFilter(IntPtr L) { try { ToLua.CheckArgsCount(L, 4); int arg0 = (int)LuaDLL.luaL_checknumber(L, 1); int arg1 = (int)LuaDLL.luaL_checknumber(L, 2); int arg2 = (int)LuaDLL.luaL_checknumber(L, 3); int arg3 = (int)LuaDLL.luaL_checknumber(L, 4); FairyGUI.ColorFilter o = Arthas.Tools.GetColorFilter(arg0, arg1, arg2, arg3); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int _CreateFairyGUI_ColorFilter(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { FairyGUI.ColorFilter obj = new FairyGUI.ColorFilter(); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: FairyGUI.ColorFilter.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void ApplyValue(TransitionItem item, TransitionValue value) { item.target._gearLocked = true; switch (item.type) { case TransitionActionType.XY: if (item.target == _owner) { float f1, f2; if (!value.b1) f1 = item.target.x; else f1 = value.f1 + _ownerBaseX; if (!value.b2) f2 = item.target.y; else f2 = value.f2 + _ownerBaseY; item.target.SetXY(f1, f2); } else { if (!value.b1) value.f1 = item.target.x; if (!value.b2) value.f2 = item.target.y; item.target.SetXY(value.f1, value.f2); } if (invalidateBatchingEveryFrame) _owner.InvalidateBatchingState(); break; case TransitionActionType.Size: if (!value.b1) value.f1 = item.target.width; if (!value.b2) value.f2 = item.target.height; item.target.SetSize(value.f1, value.f2); if (invalidateBatchingEveryFrame) _owner.InvalidateBatchingState(); break; case TransitionActionType.Pivot: item.target.SetPivot(value.f1, value.f2); if (invalidateBatchingEveryFrame) _owner.InvalidateBatchingState(); break; case TransitionActionType.Alpha: item.target.alpha = value.f1; break; case TransitionActionType.Rotation: item.target.rotation = value.f1; if (invalidateBatchingEveryFrame) _owner.InvalidateBatchingState(); break; case TransitionActionType.Scale: item.target.SetScale(value.f1, value.f2); if (invalidateBatchingEveryFrame) _owner.InvalidateBatchingState(); break; case TransitionActionType.Skew: item.target.skew = new Vector2(value.f1, value.f2); if (invalidateBatchingEveryFrame) _owner.InvalidateBatchingState(); break; case TransitionActionType.Color: ((IColorGear)item.target).color = value.c; break; case TransitionActionType.Animation: if (!value.b1) value.i = ((IAnimationGear)item.target).frame; ((IAnimationGear)item.target).frame = value.i; ((IAnimationGear)item.target).playing = value.b; break; case TransitionActionType.Visible: item.target.visible = value.b; break; case TransitionActionType.Transition: Transition trans = ((GComponent)item.target).GetTransition(value.s); if (trans != null) { if (value.i == 0) trans.Stop(false, true); else if (trans.playing) trans._totalTimes = value.i == -1 ? int.MaxValue : value.i; else { item.completed = false; _totalTasks++; if (_reversed) trans.PlayReverse(value.i, 0, () => { __playTransComplete(item); }); else trans.Play(value.i, 0, () => { __playTransComplete(item); }); if (_timeScale != 1) trans.timeScale = _timeScale; } } break; case TransitionActionType.Sound: AudioClip sound = UIPackage.GetItemAssetByURL(value.s) as AudioClip; if (sound != null) Stage.inst.PlayOneShotSound(sound, value.f1); break; case TransitionActionType.Shake: item.startValue.f1 = 0; //offsetX item.startValue.f2 = 0; //offsetY item.startValue.f3 = item.value.f2;//shakePeriod Timers.inst.AddUpdate(item.__Shake, this); _totalTasks++; item.completed = false; break; case TransitionActionType.ColorFilter: ColorFilter cf = item.target.filter as ColorFilter; if (cf == null) { cf = new ColorFilter(); item.target.filter = cf; item.filterCreated = true; } else { cf.Reset(); } cf.AdjustBrightness(value.f1); cf.AdjustContrast(value.f2); cf.AdjustSaturation(value.f3); cf.AdjustHue(value.f4); break; } item.target._gearLocked = false; }
public virtual void Setup_BeforeAdd(XML xml) { string str; string[] arr; id = xml.GetAttribute("id"); name = xml.GetAttribute("name"); arr = xml.GetAttributeArray("xy"); if (arr != null) this.SetXY(int.Parse(arr[0]), int.Parse(arr[1])); arr = xml.GetAttributeArray("size"); if (arr != null) { initWidth = int.Parse(arr[0]); initHeight = int.Parse(arr[1]); SetSize(initWidth, initHeight, true); } arr = xml.GetAttributeArray("scale"); if (arr != null) SetScale(float.Parse(arr[0]), float.Parse(arr[1])); arr = xml.GetAttributeArray("skew"); if (arr != null) this.skew = new Vector2(float.Parse(arr[0]), float.Parse(arr[1])); str = xml.GetAttribute("rotation"); if (str != null) this.rotation = int.Parse(str); arr = xml.GetAttributeArray("pivot"); if (arr != null) { float f1 = float.Parse(arr[0]); float f2 = float.Parse(arr[1]); //处理旧版本的兼容性(旧版本发布的值是坐标值,新版本是比例,一般都小于2) if (f1 > 2) { if (sourceWidth != 0) f1 = f1 / sourceWidth; else f1 = 0; } if (f2 > 2) { if (sourceHeight != 0) f2 = f2 / sourceHeight; else f2 = 0; } this.SetPivot(f1, f2, xml.GetAttributeBool("anchor")); } else this.SetPivot(0, 0, false); str = xml.GetAttribute("alpha"); if (str != null) this.alpha = float.Parse(str); this.touchable = xml.GetAttributeBool("touchable", true); this.visible = xml.GetAttributeBool("visible", true); this.grayed = xml.GetAttributeBool("grayed", false); str = xml.GetAttribute("blend"); if (str != null) this.blendMode = FieldTypes.ParseBlendMode(str); str = xml.GetAttribute("filter"); if (str != null) { switch (str) { case "color": ColorFilter cf = new ColorFilter(); this.filter = cf; arr = xml.GetAttributeArray("filterData"); cf.AdjustBrightness(float.Parse(arr[0])); cf.AdjustContrast(float.Parse(arr[1])); cf.AdjustSaturation(float.Parse(arr[2])); cf.AdjustHue(float.Parse(arr[3])); break; } } str = xml.GetAttribute("tooltips"); if (str != null) this.tooltips = str; }