public SpriteAnimationComponent( Texture2D texture, int frameRowsCount, int frameColumnsCount, int frameTimeMilliseconds, AnimateType animateType = AnimateType.All, Rectangle?sourceRectangle = null, bool isLooping = false, bool isPlaying = false, SpriteEffects spriteEffect = SpriteEffects.FlipVertically, Color color = default, float layerDepth = 0f, Vector2 scale = default, bool drawInUICamera = false) : this( texture, frameRowsCount, frameColumnsCount, TimeSpan.FromMilliseconds(frameTimeMilliseconds), animateType, sourceRectangle, isLooping, isPlaying, spriteEffect, color, layerDepth, scale, drawInUICamera) { }
public SpriteAnimationComponent( Texture2D texture, int frameRowsCount, int frameColumnsCount, TimeSpan frameTime, AnimateType animateType = AnimateType.All, Rectangle?sourceRectangle = null, bool isLooping = false, bool isPlaying = false, SpriteEffects spriteEffect = SpriteEffects.FlipVertically, Color color = default, float layerDepth = 0f, Vector2 scale = default, bool drawInUICamera = false) : base(texture, spriteEffect, color, sourceRectangle, layerDepth, scale, drawInUICamera) { FrameRowsCount = frameRowsCount; FrameColumnsCount = frameColumnsCount; FrameTime = frameTime; AnimateType = animateType; IsLooping = isLooping; IsPlaying = isPlaying; if (sourceRectangle == null) { SourceRectangle = new Rectangle(0, 0, FrameWidth, FrameHeight); } }
private Vector4 GetOriginalValue_Util(Object pObject, AnimateType pType, out bool pIsPresent) { Vector4 lReturn = new Vector4(-1.0f, -1.0f, -1.0f, -1.0f); pIsPresent = mOriginalData.TryGetValue(pObject.GetInstanceID().ToString() + ":" + ((int)pType).ToString(), out lReturn); return(lReturn); }//GetOriginalValue_Util
}//GetOriginalValue_Util public void RemoveOriginalValue_Util(Object pObject, AnimateType pType) { string lKey = pObject.GetInstanceID().ToString() + ":" + ((int)pType).ToString(); if (mOriginalData.ContainsKey(lKey)) { mOriginalData.Remove(lKey); } }//GetOriginalValue_Util
private void InitAnimate(IP2DAnimate AnimateObject, float Time, AnimateType Type, float StartDelay) { animateObject = AnimateObject; time = Time; type = Type; startDelay = StartDelay; SetStartStatus(); }
public void SetOriginalValue_Private(Object pObject, AnimateType pType, Vector4 pData) { bool lIsPresent; GetOriginalValue_Util(pObject, pType, out lIsPresent); if (!lIsPresent) { mOriginalData.Add(pObject.GetInstanceID().ToString() + ":" + ((int)pType).ToString(), pData); } }//GetOriginalValue_Util
public override void Deserialize(NetworkReader reader) { base.Deserialize(reader); Entity = reader.ReadGameObject(); Settings.PortalHeight = reader.ReadInt32(); Settings.PortalOpenTime = reader.ReadSingle(); Settings.PortalCloseTime = reader.ReadSingle(); Settings.PortalSuspenseTime = reader.ReadSingle(); Settings.EntityRotate = reader.ReadBoolean(); Type = (AnimateType)reader.ReadInt32(); }
public void ReadFrom(IDataInputStream stream) { animation = (CameraEffect.AnimateType)stream.ReadByte(); }
private AnimateType animatorType = AnimateType.Animator01; // 动画类型 #endregion #region 择动画类型 // 所有动画效果选择RadioButton的CheckedChanged事件 private void SelectAnimator(object sender, EventArgs e) { RadioButton rb = sender as RadioButton; switch (rb.Name) { case "radioButton1": animatorType = AnimateType.Animator01; // 压缩反转 break; case "radioButton2": animatorType = AnimateType.Animator02; // 垂直对接 break; case "radioButton3": animatorType = AnimateType.Animator03; // 中心闭幕 break; case "radioButton4": animatorType = AnimateType.Animator04; // 中心放大 break; case "radioButton5": animatorType = AnimateType.Animator05; // 逐行分块 break; case "radioButton6": animatorType = AnimateType.Animator06; // 交替分块 break; case "radioButton7": animatorType = AnimateType.Animator07; // 交叉竖条 break; case "radioButton8": animatorType = AnimateType.Animator08; // 透明淡入 break; case "radioButton9": animatorType = AnimateType.Animator09; // 三色淡入 break; case "radioButton10": animatorType = AnimateType.Animator10; // 水平拉幕 break; case "radioButton11": animatorType = AnimateType.Animator11; // 随机竖条 break; case "radioButton12": animatorType = AnimateType.Animator12; // 随机拉丝 break; case "radioButton13": animatorType = AnimateType.Animator13; // 垂直对切 break; case "radioButton14": animatorType = AnimateType.Animator14; // 随机分块 break; case "radioButton15": animatorType = AnimateType.Animator15; // 对角闭幕 break; case "radioButton16": animatorType = AnimateType.Animator16; // 垂直百叶 break; case "radioButton17": animatorType = AnimateType.Animator17; // 压缩竖条 break; case "radioButton18": animatorType = AnimateType.Animator18; // 水平拉入 break; case "radioButton19": animatorType = AnimateType.Animator19; // 三色对接 break; case "radioButton20": animatorType = AnimateType.Animator20; // 对角滑动 break; case "radioButton21": animatorType = AnimateType.Animator21; // 旋转放大 break; case "radioButton22": animatorType = AnimateType.Animator22; // 椭圆拉幕 break; case "radioButton23": animatorType = AnimateType.Animator23; // 对角拉伸 break; case "radioButton24": animatorType = AnimateType.Animator24; // 旋转扫描 break; case "radioButton25": animatorType = AnimateType.Animator25; // 多径扫描 break; case "radioButton26": animatorType = AnimateType.Animator26; // 随机落幕 break; case "radioButton27": animatorType = AnimateType.Animator27; // 螺线内旋 break; case "radioButton28": animatorType = AnimateType.Animator28; // 灰度扫描 break; case "radioButton29": animatorType = AnimateType.Animator29; // 负片追踪 break; default: animatorType = AnimateType.Animator30; // 水平卷轴 break; } }
public void Add(IP2DAnimate animateObject, Vector2 startPosition, Vector2 endPosition, float time, AnimateType Type = AnimateType.linear, float startDelay = 0) { CheckExistingAnimate(animateObject); animations.Add(new AnimateStructP2D(animateObject, startPosition, endPosition, time, Type, startDelay)); }
public CharacterViewEffect(Vec4 tint, AnimateType animation) { this.tint = tint; this.animation = animation; }
public void ReadFrom(IDataInputStream stream) { animation = (CharacterViewEffect.AnimateType)stream.ReadByte(); tint.ReadFrom(stream); }
/// <summary> /// 以独立线程的方式开始显示动画。 /// </summary> /// <param name="animateType">动画类型枚举</param> public void DrawAnimator(AnimateType animateType) { if (drawStarted) // 判断动画是否已经开始绘制 { if (pauseEvent.WaitOne(0)) // 动画已开始,但被暂停了,继续 pauseEvent.Reset(); else pauseEvent.Set(); return; } ThreadStart threadMethod; switch (animateType) { case AnimateType.Animator01: threadMethod = Animator01; break; case AnimateType.Animator02: threadMethod = Animator02; break; case AnimateType.Animator03: threadMethod = Animator03; break; case AnimateType.Animator04: threadMethod = Animator04; break; case AnimateType.Animator05: threadMethod = Animator05; break; case AnimateType.Animator06: threadMethod = Animator06; break; case AnimateType.Animator07: threadMethod = Animator07; break; case AnimateType.Animator08: threadMethod = Animator08; break; case AnimateType.Animator09: threadMethod = Animator09; break; case AnimateType.Animator10: threadMethod = Animator10; break; case AnimateType.Animator11: threadMethod = Animator11; break; case AnimateType.Animator12: threadMethod = Animator12; break; case AnimateType.Animator13: threadMethod = Animator13; break; case AnimateType.Animator14: threadMethod = Animator14; break; case AnimateType.Animator15: threadMethod = Animator15; break; case AnimateType.Animator16: threadMethod = Animator16; break; case AnimateType.Animator17: threadMethod = Animator17; break; case AnimateType.Animator18: threadMethod = Animator18; break; case AnimateType.Animator19: threadMethod = Animator19; break; case AnimateType.Animator20: threadMethod = Animator20; break; case AnimateType.Animator21: threadMethod = Animator21; break; case AnimateType.Animator22: threadMethod = Animator22; break; case AnimateType.Animator23: threadMethod = Animator23; break; case AnimateType.Animator24: threadMethod = Animator24; break; case AnimateType.Animator25: threadMethod = Animator25; break; case AnimateType.Animator26: threadMethod = Animator26; break; case AnimateType.Animator27: threadMethod = Animator27; break; case AnimateType.Animator28: threadMethod = Animator28; break; case AnimateType.Animator29: threadMethod = Animator29; break; default: threadMethod = Animator30; break; } Thread drawThread = new Thread(threadMethod); drawThread.IsBackground = true; // 设为后台线程,避免该线程未结束时退出主线程而引发异常 drawThread.Start(); }
public AnimateStructP2D(IP2DAnimate AnimateObject, float AnimateTime, AnimateType Type = AnimateType.linear, float StartDelay = 0) { InitAnimate(AnimateObject, AnimateTime, Type, StartDelay); }
public AnimateStructP2D(IP2DAnimate AnimateObject, Vector2 StartPosition, Vector2 EndPosition, float AnimateTime, AnimateType Type = AnimateType.linear, float StartDelay = 0) { InitAnimate(AnimateObject, AnimateTime, Type, StartDelay); AddMoveToAnimate(StartPosition, EndPosition); }
/// <summary> /// 执行控件的打开动画 /// </summary> /// <param name="form"></param> public static void SetOpenAnimateMode(System.Windows.Forms.Control targetControl, AnimateType animateType = AnimateType.AW_ACTIVATE) { try { AnimateWindow(targetControl.Handle, Convert.ToInt32(500), (int)animateType); } catch { } }
}//GetOriginalValue_Util //public void SetOriginalValue_Private( Object pObject, AnimType pType, float pData ){ SetOriginalValue_Private( pObject, pType, new Vector4( pData, 0.0f, 0.0f, 0.0f ) ); } public void SetOriginalValue_Private(Object pObject, AnimateType pType, Vector3 pData) { SetOriginalValue_Private(pObject, pType, (Vector4)pData); }
public CameraEffect(AnimateType animation) { this.animation = animation; }
public Vector3 GetOriginalV3_Private(Object pObject, AnimateType pType) { bool lIsPresent; Vector4 lReturn = GetOriginalValue_Util(pObject, pType, out lIsPresent); return((Vector3)lReturn); }
public Vector4 GetOriginalV4_Private(Object pObject, AnimateType pType) { bool lIsPresent; return(GetOriginalValue_Util(pObject, pType, out lIsPresent)); }
/// <summary> /// 执行控件的隐藏动画 /// </summary> /// <param name="form"></param> public static void SetCloseAnimateMode(System.Windows.Forms.Control targetControl, AnimateType animateType = AnimateType.AW_HIDE) { try { AnimateWindow(targetControl.Handle, Convert.ToInt32(500), (int)(AnimateType.AW_HIDE | animateType)); } catch { } }
/// <summary> /// <inheritdoc cref="PortalSpawnAnimateMessage"/> /// </summary> /// <param name="portal">The portal GameObject that the client should animate.</param> /// <param name="settings">The settings the portal should be animated with.</param> /// <returns></returns> public static NetMessage SendToVisible(GameObject entity, PortalSpawnInfo settings, AnimateType type) { var msg = new NetMessage() { Entity = entity, Settings = settings, Type = type, }; SendToVisiblePlayers(entity.RegisterTile().WorldPositionServer.To2Int(), msg); return(msg); }