public Player(MonoGameLibrary.Game game, GameScreen screen, int x, int y, int width, int height) : base(game, screen, Assets.GameObject.Player, x, y, width, height) { IsRigitBody = true; a = new TextureAnimator(game, this, Assets.GameObject.Dust, 300, 0.1, -150, 120, 300, 100); Animators.Add(a); }
/// <summary> Show tooltip at position with text </summary> public void Show(Point pos, string text) { if (Visible == false) { var size = GLOFC.Utils.BitMapHelpers.MeasureStringInBitmap(text, Font, StringFormat); Location = new Point(pos.X + AutoPlacementOffset.X, pos.Y + AutoPlacementOffset.Y); ClientSize = new Size((int)size.Width + 1, (int)size.Height + 1); TopMost = true; tiptext = text; Visible = true; Invalidate(); // must invalidate as paint uses tiptext. if (Parent is GLControlDisplay) { if (FadeInTime > 0) // if we are attached to control display, and we are fading in, do it { Opacity = 0; Animators.Add(new AnimateOpacity(0, FadeInTime, true, ShownOpacity, 0.0f, true)); // note delta time } else { Opacity = ShownOpacity; } } } }
protected override void Init(MyObjectBuilder_DefinitionBase def) { base.Init(def); var ob = (MyObjectBuilder_RailSwitchExternalComponentDefinition)def; _layers.Clear(); if (ob.Layers != null) { foreach (var lay in ob.Layers) { _layers.Add(lay); } } MaxAttachmentDistance = ob.MaxAttachmentDistance ?? 1f; MaxAttachmentDistanceSq = MaxAttachmentDistance * MaxAttachmentDistance; ControllerLocation = ob.ControllerLocation ?? Vector3.Zero; AllowDynamic = ob.AllowDynamic ?? false; Animators.Clear(); if (ob.Animators != null) { foreach (var k in ob.Animators) { Animators.Add(new ImmutableAnimator(k)); } } }
public testObject(MonoGameLibrary.Game game, Screen screen, int x, int y, int width, int height) : base(game, screen, Assets.enemy, x, y, width, height) { TextureAnimator a = new TextureAnimator(game, this, Assets.smoke, 360, 0, 0.016); Animators.Add(a); a.Start(); }
public Button(MonoGameLibrary.Game game, Screen screen, int x, int y, int width, int height) : base(game, screen, Assets.getColorTexture(game, Color.Blue), x, y, width, height) { OnHover += onHover; OnLeave += onLeave; OnDown += onClick; a = new MoveAnimator(game, this, 1, 1, new Point(0, 0), new Point(100, 100), new Point(1000, 400), new Point(1000, 500)); Animators.Add(a); }
public Player(Game1 game, Screen screen, int x, int y, int width, int height) : base(game, screen, Assets.image, x, y, width, height) { parent = (TestScreen)screen; a = new FlashAnimator(game, this, 0.1, 0, 0.1, 0); Animators.Add(a); a.Enable = false; //a.Start(); }
/// <summary> /// アニメーターを追加する。ループするアニメーターは使えません。 /// </summary> /// <param name="animator">アニメーター。</param> /// <returns>シーケンサー。メソッドチェーンできます。</returns> public Sequencer AddAnimator(Animator animator) { if (animator != null) { if (!animator.IsLoop) { Animators.Add(animator); } else { throw new NotSupportedException("Animator can not be loop."); } } return(this); }
/// <summary> Hide tooltip. Can be reshown.</summary> public void Hide() { if (Visible) { if (Parent is GLControlDisplay && FadeOutTime > 0) { var animate = new AnimateOpacity(0, FadeOutTime, true, 0.0f, Opacity, true); animate.FinishAction = (an, ctrl, time) => { ctrl.Visible = false; // animators are removed at this point, find out what the positional mouse args would be and call again to give the next control the chance var me = FindDisplay().MouseEventArgsFromPoint(FindDisplay().MouseWindowPosition); MouseMoved(me); }; Animators.Add(animate); } else { Visible = false; } } }
void IState.SetAnimator(UnityEngine.Animator animator) { Animators.Clear(); Animators.Add(animator); }
void IState.AddAnimator(UE.Animator animator) { Animators.Add(animator); }