private void ReturnZoom(ZoomAnimation inZoom) { CameraZoomController zoomer = GetComponent <CameraZoomController>(); zoomer.Curve = inZoom.Curve; zoomer.ReturnToResting(inZoom.Time); }
public AwakenedBannerLabel2D(ALayer2D parentLayer) : base(parentLayer) { this.CreateTextParagraph2D(new Vector2f(0, 0), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 60); this.Canevas = new IntRect(0, 0, 2000, 0); this.Position = new Vector2f(-1000, -50); this.UpdateTextOfParagraph(0, "awakened_label"); SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(5), AnimationType.ONETIME); IAnimation anim = new ColorAnimation(new Color(0, 0, 0, 0), new Color(0, 0, 0, 255), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0, anim); this.animationsList.Add(sequence); anim = new ZoomAnimation(0f, 1, Time.FromSeconds(2), AnimationType.ONETIME, InterpolationMethod.SQUARE_DEC); sequence.AddAnimation(1f, anim); anim = new ZoomAnimation(1f, 10, Time.FromSeconds(2), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); sequence.AddAnimation(3, anim); anim = new ColorAnimation(new Color(0, 0, 0, 255), new Color(0, 0, 0, 0), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(4f, anim); this.animationsList.Add(sequence); this.IsActive = false; }
private void StartZoom(float inSize, ZoomAnimation inZoom) { CameraZoomController zoomer = GetComponent <CameraZoomController>(); zoomer.Curve = inZoom.Curve; zoomer.ZoomToSize(inSize, inZoom.Time); }
public T_TeleEntity2D(IObject2DFactory factory, ALayer2D layer2D, T_TeleEntity entity) : base(layer2D, factory, entity) { this.Position = entity.Position; this.Rotation = entity.Rotation; this.ObjectSprite.Texture = factory.GetTextureById("TVTexture"); this.ObjectSprite.TextureRect = new SFML.Graphics.IntRect(0, 0, 86, 76); this.ObjectSprite.Origin = new SFML.System.Vector2f(this.ObjectSprite.TextureRect.Width / 2, this.ObjectSprite.TextureRect.Height / 2); SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(20), AnimationType.LOOP); IAnimation anim = new ZoomAnimation(1, 2, Time.FromSeconds(10), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0, anim); anim = new ZoomAnimation(2, 1, Time.FromSeconds(10), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(10, anim); anim = new FrameAnimation(new SFML.Graphics.IntRect[] { new SFML.Graphics.IntRect(0, 0, 86, 76), new SFML.Graphics.IntRect(86, 0, 86, 76) }, Time.FromSeconds(2), AnimationType.LOOP, InterpolationMethod.LINEAR); sequence.AddAnimation(10.01f, anim); this.animationsList.Add(sequence); this.PlayAnimation(0); }
public EndLevelBanner2D(ALayer2D parentLayer) : base(parentLayer) { this.paragraphRows = new List <List <TextParagraph2D> >(); this.bannerShape = new RectangleShape(new Vector2f(1000, 1000)); this.bannerShape.FillColor = new Color(0, 0, 0, 200); this.Position = new Vector2f(0, 0); this.isDraw = false; IAnimation anim = new ZoomAnimation(0, 1, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); this.animationsList.Add(anim); anim = new ColorAnimation(new Color(0, 0, 0, 0), new Color(0, 0, 0, 255), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); this.animationsList.Add(anim); anim = new ZoomAnimation(1, 2, Time.FromSeconds(3), AnimationType.ONETIME, InterpolationMethod.LINEAR); this.animationsList.Add(anim); this.State = BannerState.START; this.IsActive = false; }
public StarEffect2D(IObject2DFactory factory, ALayer2D parentLayer, CardEntityAwakenedDecorator2D parentCardDecorator2D) : base(parentLayer, factory, false) { this.Position = parentCardDecorator2D.Position; this.ObjectSprite.Texture = factory.GetTextureById("starEffectTexture"); this.ObjectSprite.Origin = new SFML.System.Vector2f(this.ObjectSprite.TextureRect.Width / 2, this.ObjectSprite.TextureRect.Height / 2); // Active animation SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(4), AnimationType.ONETIME); IAnimation anim = new ZoomAnimation(0.1f, 1, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); sequence.AddAnimation(0, anim); //anim = new ZoomAnimation(1, 0.1f, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); //sequence.AddAnimation(5, anim); anim = new RotationAnimation(0, 360, Time.FromSeconds(6), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0.01f, anim); this.animationsList.Add(sequence); this.IsActive = false; }
void ChangeCursor() { audio.PlayOneShot(switchSound); cursor = columns[currentColumn][currentRow]; StartCoroutine(ZoomAnimation.Zoom(cursor)); LauncherInterface.selection = cursor.GetComponent <Action>().action; }
public EndTurnButton2D(ALayer2D parentLayer) : base(parentLayer) { this.bannerShape = new RectangleShape(new Vector2f(200, 75)); this.SpriteColor = new Color(0, 0, 0, 255); this.Position = new Vector2f(0, 0); this.idLabelToIndex = new Dictionary <string, int>(); this.CreateTextParagraph2D(new Vector2f(0, 25), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 20); this.UpdateTextOfParagraph(0, "end_turn"); this.CreateTextParagraph2D(new Vector2f(0, 25), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 20); this.UpdateTextOfParagraph(1, "pass_action"); this.CreateTextParagraph2D(new Vector2f(0, 25), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 20); this.UpdateTextOfParagraph(2, "destroy_action"); this.CreateTextParagraph2D(new Vector2f(0, 25), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 20); this.UpdateTextOfParagraph(3, "convert_action"); this.CreateTextParagraph2D(new Vector2f(0, 25), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 20); this.UpdateTextOfParagraph(4, "addPoints_action"); this.idLabelToIndex.Add("DeleteCardNotifBehavior." + Enum.GetName(typeof(Model.Layer.BoardNotifLayer.Behavior.DeleteCardNotifBehavior.DeleteState), Model.Layer.BoardNotifLayer.Behavior.DeleteCardNotifBehavior.DeleteState.PICK_CARD), 1); this.idLabelToIndex.Add("DeleteCardNotifBehavior." + Enum.GetName(typeof(Model.Layer.BoardNotifLayer.Behavior.DeleteCardNotifBehavior.DeleteState), Model.Layer.BoardNotifLayer.Behavior.DeleteCardNotifBehavior.DeleteState.CAN_DELETE_CARD), 2); this.idLabelToIndex.Add("ConvertCardNotifBehavior." + Enum.GetName(typeof(Model.Layer.BoardNotifLayer.Behavior.ConvertCardNotifBehavior.DeleteState), Model.Layer.BoardNotifLayer.Behavior.ConvertCardNotifBehavior.DeleteState.PICK_CARD), 1); this.idLabelToIndex.Add("ConvertCardNotifBehavior." + Enum.GetName(typeof(Model.Layer.BoardNotifLayer.Behavior.ConvertCardNotifBehavior.DeleteState), Model.Layer.BoardNotifLayer.Behavior.ConvertCardNotifBehavior.DeleteState.CAN_DELETE_CARD), 3); this.idLabelToIndex.Add("AddPointsNotifBehavior." + Enum.GetName(typeof(Model.Layer.BoardNotifLayer.Behavior.ConvertCardNotifBehavior.DeleteState), Model.Layer.BoardNotifLayer.Behavior.ConvertCardNotifBehavior.DeleteState.PICK_CARD), 1); this.idLabelToIndex.Add("AddPointsNotifBehavior." + Enum.GetName(typeof(Model.Layer.BoardNotifLayer.Behavior.ConvertCardNotifBehavior.DeleteState), Model.Layer.BoardNotifLayer.Behavior.ConvertCardNotifBehavior.DeleteState.CAN_DELETE_CARD), 4); IAnimation showAnimation = new ColorAnimation(new Color(0, 0, 0, 0), new Color(0, 0, 0, 255), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); this.animationsList.Add(showAnimation); SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(2), AnimationType.LOOP); IAnimation focusedAnimation = new ColorAnimation(new Color(0, 0, 0, 255), new Color(125, 125, 125, 255), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0, focusedAnimation); focusedAnimation = new ColorAnimation(new Color(125, 125, 125, 255), new Color(0, 0, 0, 255), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(1, focusedAnimation); this.animationsList.Add(sequence); IAnimation hideAnimation = new ColorAnimation(new Color(0, 0, 0, 255), new Color(0, 0, 0, 0), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); this.animationsList.Add(hideAnimation); IAnimation labelChangedAnimation = new ZoomAnimation(2, 1, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); this.animationsList.Add(labelChangedAnimation); this.isActive = false; }
public StarEntity2D(IObject2DFactory factory, ALayer2D parentLayer, StarEntity entity) : base(parentLayer, factory, entity) { Shader shader = new Shader(null, null, @"Assets\Graphics\Shaders\StarFrag.frag"); Texture distortionMap = factory.GetTextureById("distortionTexture"); distortionMap.Repeated = true; distortionMap.Smooth = true; shader.SetUniform("currentTexture", new Shader.CurrentTextureType()); shader.SetUniform("distortionMapTexture", distortionMap); render = new RenderStates(BlendMode.Alpha); render.Shader = shader; this.isFocused = true; this.IsFocused = false; this.SetCardSocketed(entity.CardSocketed); this.ObjectSprite.Texture = factory.GetTextureById("starTexture"); this.ObjectSprite.Origin = new SFML.System.Vector2f(this.ObjectSprite.TextureRect.Width / 2, this.ObjectSprite.TextureRect.Height / 2); // Active animation SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(4), AnimationType.LOOP); IAnimation anim = new ZoomAnimation(1, 1.5f, Time.FromSeconds(2), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0, anim); anim = new ZoomAnimation(1.5f, 1, Time.FromSeconds(2), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(2, anim); this.animationsList.Add(sequence); // Start : Transitioning active animation Random rand = new Random(); float startTime = (float)(rand.NextDouble() * 2); sequence = new SequenceAnimation(Time.FromSeconds(startTime + 2), AnimationType.ONETIME); anim = new ZoomAnimation(0, 0, Time.FromSeconds(startTime), AnimationType.ONETIME, InterpolationMethod.STEP); sequence.AddAnimation(0, anim); anim = new ZoomAnimation(0f, 1f, Time.FromSeconds(2), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(startTime, anim); this.animationsList.Add(sequence); this.InitializeState(entity); }
public AObject2D() { this.sprite = new Sprite(); this.text = new Text(); this.animationsList = new List <IAnimation>(); this.currentCanevas = new IntRect(); Time periode = Time.FromMilliseconds(2000); ZoomAnimation zoomAnimation = new ZoomAnimation(1, 1.1f, periode, AnimationType.LOOP); this.AddAnimation(zoomAnimation); }
public void HideStarEffect() { this.IsActive = false; SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(1), AnimationType.ONETIME); IAnimation anim = new ZoomAnimation(1, 0.1f, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); sequence.AddAnimation(0, anim); anim = new RotationAnimation(this.Rotation, this.Rotation + 60, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0.01f, anim); this.PlayAnimation(sequence); }
public CJStarDomain2D(ALayer2D layer2D, IObject2DFactory factory, CJStarDomain entity) : base(layer2D, factory, entity) { // TO REMOVE //this.Test(); //this.widthRatio = 0; //this.heightRatio = 0; this.targetedColor = Color.Black; Shader shader = new Shader(null, null, @"Assets\Graphics\Shaders\StarDomain.frag"); Texture distortionMap = factory.GetTextureById("distorsionTexture"); this.ObjectSprite.Texture = factory.GetTextureById("distorsionTexture"); this.ObjectSprite.Texture.Repeated = true; distortionMap.Repeated = true; distortionMap.Smooth = true; shader.SetUniform("currentTexture", new Shader.CurrentTextureType()); render = new RenderStates(BlendMode.Alpha); render.Shader = shader; this.isFocused = true; this.IsFocused = false; this.Priority = entity.Priority; this.domainStars = entity.Domain.Select(pElem => layer2D.GetEntity2DFromEntity(pElem) as StarEntity2D).ToList(); this.isFilled = entity.IsFilled; shader.SetUniform("isFilled", this.isFilled); SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(6), AnimationType.ONETIME); IAnimation anim = new ZoomAnimation(1f, 2f, Time.FromSeconds(2), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); sequence.AddAnimation(0, anim); anim = new ZoomAnimation(2f, 1f, Time.FromSeconds(3), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); sequence.AddAnimation(2, anim); this.animationsList.Add(sequence); this.UpdateScaling(entity); this.StartNotActiveState(); }
private IAnimation CreateTransitioningAnimation() { IAnimation result; if (this.isActive) { float time = Math.Abs(3 - this.Zoom); result = new ZoomAnimation(this.Zoom, ZOOM_AWAKENED, Time.FromSeconds(time), AnimationType.ONETIME, InterpolationMethod.SQUARE_DEC); } else { float time = Math.Abs(this.Zoom); result = new ZoomAnimation(this.Zoom, 0f, Time.FromSeconds(time), AnimationType.ONETIME, InterpolationMethod.SQUARE_DEC); } return(result); }
private IAnimation CreateTransitioningAnimation() { IAnimation result; if (this.isActive) { float time = Math.Abs(1 - this.Zoom) * 2; result = new ZoomAnimation(this.Zoom, 1f, Time.FromSeconds(time), AnimationType.ONETIME, InterpolationMethod.LINEAR); } else { float time = Math.Abs(this.Zoom) * 2; result = new ZoomAnimation(this.Zoom, 0f, Time.FromSeconds(time), AnimationType.ONETIME, InterpolationMethod.LINEAR); } return(result); }
public CardsToPlaceBanner2D(ALayer2D parentLayer) : base(parentLayer) { this.bannerShape = new RectangleShape(new Vector2f(400, 50)); this.SpriteColor = new Color(0, 0, 0, 255); this.Position = new Vector2f(0, 0); IAnimation labelChangedAnimation = new ZoomAnimation(2, 1, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); this.animationsList.Add(labelChangedAnimation); this.CreateTextParagraph2D(new Vector2f(0, 10), new Vector2f(0, 0), Text2D.TextParagraph2D.Alignment.CENTER, 20); this.UpdateTextOfParagraph(0, "turn_banner_socket_cards"); this.cardsToPlaceCount = -1; this.IsActive = true; }
public CardLabel2D(ALayer2D parentLayer, int label) : base(parentLayer) { this.label = int.MinValue; this.Bonus = 0; this.bannerShape = new RectangleShape(new Vector2f(50, 25)); this.Position = new Vector2f(0, 0); this.CreateTextParagraph2D(new Vector2f(0, 0), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 30); this.UpdateTextOfParagraph(0, "field_content"); this.SpriteColor = new Color(255, 255, 255, 0); IAnimation showAnimation = new ColorAnimation(new Color(255, 255, 255, 0), new Color(255, 255, 255, 255), Time.FromSeconds(0.5f), AnimationType.ONETIME, InterpolationMethod.LINEAR); this.animationsList.Add(showAnimation); //SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(2), AnimationType.LOOP); //IAnimation focusedAnimation = new ColorAnimation(new Color(0, 0, 0, 255), new Color(125, 125, 125, 255), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); //sequence.AddAnimation(0, focusedAnimation); //focusedAnimation = new ColorAnimation(new Color(125, 125, 125, 255), new Color(0, 0, 0, 255), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); //sequence.AddAnimation(1, focusedAnimation); //this.animationsList.Add(sequence); IAnimation hideAnimation = new ColorAnimation(new Color(255, 255, 255, 255), new Color(255, 255, 255, 0), Time.FromSeconds(0.5f), AnimationType.ONETIME, InterpolationMethod.LINEAR); this.animationsList.Add(hideAnimation); IAnimation labelChangedAnimation = new ZoomAnimation(3, 1, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); this.animationsList.Add(labelChangedAnimation); this.IsActive = false; this.Label = label; }
public ScoreLabel2D(ALayer2D parentLayer) : base(parentLayer) { this.score = -1; this.bannerShape = new RectangleShape(new Vector2f(200, 170)); this.SpriteColor = new Color(0, 0, 0, 255); this.Position = new Vector2f(0, 0); IAnimation labelChangedAnimation = new ZoomAnimation(2, 1, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); this.animationsList.Add(labelChangedAnimation); this.CreateTextParagraph2D(new Vector2f(0, 10), new Vector2f(0, 0), Text2D.TextParagraph2D.Alignment.CENTER, 20); this.CreateTextParagraph2D(new Vector2f(0, 110), new Vector2f(0, 0), Text2D.TextParagraph2D.Alignment.CENTER, 20); this.CreateTextParagraph2D(new Vector2f(0, 30), new Vector2f(0, 0), Text2D.TextParagraph2D.Alignment.CENTER, 70); this.UpdateTextOfParagraph(2, "field_title"); this.IsActive = false; }
public EffectBanner2D(ALayer2D parentLayer) : base(parentLayer, null, false) { this.bannerShape = new RectangleShape(new Vector2f(3000, 200)); this.bannerShape.Origin = new Vector2f(this.bannerShape.Size.X / 2, this.bannerShape.Size.Y / 2); this.bannerShape.FillColor = new Color(0, 0, 0, 128); this.Position = new Vector2f(0, 0); SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(6), AnimationType.ONETIME); IAnimation anim = new ZoomAnimation(0, 1, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0, anim); anim = new ZoomAnimation(1, 0, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(5, anim); this.animationsList.Add(sequence); this.IsActive = false; }
public CardHalo2D(IObject2DFactory factory, ALayer2D parentLayer, CardEntity2D parentCard) : base(parentLayer, factory, false) { Shader shader = new Shader(null, null, @"Assets\Graphics\Shaders\CardHalo.frag"); Texture distortionMap = factory.GetTextureById("distorsionTexture"); distortionMap.Repeated = true; distortionMap.Smooth = true; shader.SetUniform("currentTexture", new Shader.CurrentTextureType()); shader.SetUniform("distortionMapTexture", distortionMap); render = new RenderStates(BlendMode.Alpha); render.Shader = shader; this.isFocused = true; this.SpriteColor = Color.Yellow; this.ObjectSprite.Texture = factory.GetTextureById("starHaloTexture"); this.ObjectSprite.Origin = new SFML.System.Vector2f(this.ObjectSprite.TextureRect.Width / 2, this.ObjectSprite.TextureRect.Height / 2); // Active animation SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(4), AnimationType.LOOP); IAnimation anim = new ZoomAnimation(ZOOM_AWAKENED, ZOOM_AWAKENED + .5f, Time.FromSeconds(2), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0, anim); anim = new ZoomAnimation(ZOOM_AWAKENED + .5f, ZOOM_AWAKENED, Time.FromSeconds(2), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(2, anim); this.animationsList.Add(sequence); this.Initialize(parentCard); }
public ScoreDomainLabel2D(ALayer2D parentLayer, Player player1, Player player2) : base(parentLayer) { this.ownerName = null; this.isTemporaryOwner = false; this.zoomState = ZoomVSState.STOP; this.Canevas = new IntRect(0, 0, 500, 200); this.CreateTextParagraph2D(new Vector2f(0, 0), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 20); this.CreateTextParagraph2D(new Vector2f(0, 50), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 60); this.UpdateTextOfParagraph(0, "score_domain_label"); this.UpdateTextOfParagraph(1, "score_domain_vs"); this.CreateTextParagraph2D(new Vector2f(0, 100), new Vector2f(0, 0), TextParagraph2D.Alignment.LEFT, 20); this.CreateTextParagraph2D(new Vector2f(0, 100), new Vector2f(0, 0), TextParagraph2D.Alignment.RIGHT, 20); SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(4), AnimationType.ONETIME); IAnimation anim = new ColorAnimation(new Color(0, 0, 0, 0), new Color(0, 0, 0, 255), Time.FromSeconds(2f), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0.001f, anim); anim = new ZoomAnimation(2, 1, Time.FromSeconds(4f), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0, anim); this.animationsList.Add(sequence); anim = new ColorAnimation(new Color(0, 0, 0, 255), new Color(0, 0, 0, 0), Time.FromSeconds(1f), AnimationType.ONETIME, InterpolationMethod.LINEAR); this.animationsList.Add(anim); this.InitializeScoreDomainLabel(parentLayer, player1, player2); this.Position = new Vector2f(0, 0); this.IsActive = false; }
public EffectBehaviorLabel2D(ALayer2D parentLayer) : base(parentLayer) { this.startingPosition = new Vector2f(0, 0); this.offset = new Vector2f(0, 0); this.bannerShape = new RectangleShape(new Vector2f(500, 200)); this.SpriteColor = new Color(0, 0, 0, 255); this.Position = new Vector2f(0, 0); this.idLabelToIndex = new Dictionary <Type, string>(); this.CreateTextParagraph2D(new Vector2f(0, 15), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 30); this.UpdateTextOfParagraph(0, "field_title"); this.textParagraph2Ds[0].UpdateParameterColor(0, new Color(200, 200, 200, 255)); this.CreateTextParagraph2D(new Vector2f(0, 60), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 20); this.UpdateTextOfParagraph(1, "behavior_header_label"); this.CreateTextParagraph2D(new Vector2f(0, 110), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 20); this.CreateTextParagraph2D(new Vector2f(25, 150), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 20); this.UpdateTextOfParagraph(3, "behavior_using_label"); this.CreateTextParagraph2D(new Vector2f(-355, 145), new Vector2f(0, 0), TextParagraph2D.Alignment.CENTER, 30); this.UpdateTextOfParagraph(4, "field_title"); this.textParagraph2Ds[4].UpdateParameterColor(0, Color.Green); this.idLabelToIndex.Add(typeof(Model.Layer.BoardNotifLayer.Behavior.MoveCardNotifBehavior), "move_behavior_label"); this.idLabelToIndex.Add(typeof(Model.Layer.BoardNotifLayer.Behavior.SwapCardNotifBehavior), "swap_behavior_label"); this.idLabelToIndex.Add(typeof(Model.Layer.BoardNotifLayer.Behavior.DeleteCardNotifBehavior), "delete_behavior_label"); this.idLabelToIndex.Add(typeof(Model.Layer.BoardNotifLayer.Behavior.ResurrectCardNotifBehavior), "resurrect_behavior_label"); this.idLabelToIndex.Add(typeof(Model.Layer.BoardNotifLayer.Behavior.SocketCardNotifBehavior), "play_behavior_label"); this.idLabelToIndex.Add(typeof(Model.Layer.BoardNotifLayer.Behavior.SocketNewCardNotifBehavior), "play_new_behavior_label"); this.idLabelToIndex.Add(typeof(Model.Layer.BoardNotifLayer.Behavior.ConvertCardNotifBehavior), "convert_behavior_label"); this.idLabelToIndex.Add(typeof(Model.Layer.BoardNotifLayer.Behavior.AddPointsNotifBehavior), "addPoints_behavior_label"); IAnimation showAnimation = new PositionAnimation(new Vector2f(0, 0), new Vector2f(this.Canevas.Width, 0), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); this.animationsList.Add(showAnimation); //IAnimation showAnimation = new ColorAnimation(new Color(0, 0, 0, 0), new Color(0, 0, 0, 255), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); //this.animationsList.Add(showAnimation); //SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(2), AnimationType.LOOP); //IAnimation focusedAnimation = new ColorAnimation(new Color(0, 0, 0, 255), new Color(125, 125, 125, 255), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); //sequence.AddAnimation(0, focusedAnimation); //focusedAnimation = new ColorAnimation(new Color(125, 125, 125, 255), new Color(0, 0, 0, 255), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); //sequence.AddAnimation(1, focusedAnimation); //this.animationsList.Add(sequence); //IAnimation hideAnimation = new ColorAnimation(new Color(0, 0, 0, 255), new Color(0, 0, 0, 0), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); //this.animationsList.Add(hideAnimation); IAnimation hideAnimation = new PositionAnimation(new Vector2f(this.Canevas.Width, 0), new Vector2f(0, 0), Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); this.animationsList.Add(hideAnimation); IAnimation labelChangedAnimation = new ZoomAnimation(2, 1, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); this.animationsList.Add(labelChangedAnimation); this.IsActive = false; }
IEnumerator Start() { // Recreate the appslist columns.Clear(); columns.Add(new List <GameObject> ()); // Standard Apps foreach (GameObject g in standardApps) { if (columns[columns.Count - 1].Count == 3) { columns.Add(new List <GameObject> ()); } Vector3 appPos = new Vector3((columns.Count - 1) * 17 - 29, -(columns[columns.Count - 1].Count - 1) * 10, 0); obj = null; if (g != developerTile) { obj = (GameObject)Instantiate(g, appPos, Quaternion.identity); } else if (Settings.developer) { obj = (GameObject)Instantiate(g, appPos, Quaternion.identity); } if (obj != null) { columns[columns.Count - 1].Add(obj); } } // Add Stub Apps to list // TODO Real Apps for (int i = 0; i < stubApps; i++) { if (columns[columns.Count - 1].Count == 3) { columns.Add(new List <GameObject> ()); } Vector3 appPos = new Vector3((columns.Count - 1) * 17 - 29, -(columns[columns.Count - 1].Count - 1) * 10, 0); obj = (GameObject)Instantiate(stubApp, appPos, Quaternion.identity); columns[columns.Count - 1].Add(obj); } // Set Cursor Position currentRow = 0; currentColumn = 0; cursor = columns[currentColumn][currentRow]; StartCoroutine(ZoomAnimation.Zoom(cursor)); // Wait For Wallpaper while (Settings.wallpaper == null) { yield return(null); } // Set Wallpaper for (int i = 0; i < columns.Count; i++) { foreach (GameObject g in columns[i]) { g.renderer.material.SetTexture("_Wallpaper", Settings.wallpaper); } } }
public CardEntity2D(IObject2DFactory factory, ALayer2D layer2D, CardEntity entity) : base(layer2D, factory, true) { this.cardHalo = new CardHalo2D(factory, layer2D, this); this.cardLabel = new CardLabel2D(layer2D, entity.CardValue); this.ObjectSprite.Texture = factory.GetTextureById("backCardTexture"); this.ObjectSprite.Origin = new Vector2f(this.ObjectSprite.TextureRect.Width / 2, this.ObjectSprite.TextureRect.Height / 2); this.canevasSprite = new Sprite(); this.canevasSprite.TextureRect = new IntRect(0, 0, this.ObjectSprite.TextureRect.Width + 2 * WIDTH_BORDER, this.ObjectSprite.TextureRect.Height + 2 * WIDTH_BORDER); this.canevasSprite.Origin = new Vector2f(this.canevasSprite.TextureRect.Width / 2, this.canevasSprite.TextureRect.Height / 2); this.Position = entity.Position; this.Rotation = entity.Rotation; this.canevasSprite.Color = Color.Black; this.playerColor = Color.Black; this.isSocketed = entity.ParentStar == null; this.ratioColor = -1; this.isFocused = true; this.isSelected = !entity.IsSelected; Shader shader = new Shader(null, null, @"Assets\Graphics\Shaders\CardCanevas.frag"); Texture distortionMap = factory.GetTextureById("distorsionTexture"); distortionMap.Repeated = true; distortionMap.Smooth = true; this.canevasSprite.Texture = distortionMap; shader.SetUniform("distortionMapTexture", distortionMap); render = new RenderStates(BlendMode.Alpha); render.Shader = shader; //SequenceAnimation flipAnimation = new SequenceAnimation(Time.FromSeconds(1), AnimationType.ONETIME); IAnimation animation = new FlipAnimation(0, (float)(Math.PI / 2), Time.FromSeconds(TIME_FLIP), AnimationType.ONETIME, InterpolationMethod.LINEAR, 1); //flipAnimation.AddAnimation(0, animation); this.animationsList.Add(animation); animation = new FlipAnimation((float)(Math.PI / 2), 0, Time.FromSeconds(TIME_FLIP), AnimationType.ONETIME, InterpolationMethod.LINEAR, 1); //flipAnimation.AddAnimation(0.5f, animation); this.animationsList.Add(animation); SequenceAnimation sequenceAnimation = new SequenceAnimation(Time.FromSeconds(1f), AnimationType.LOOP); animation = new ZoomAnimation(0.9f, 1.1f, Time.FromSeconds(0.5f), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequenceAnimation.AddAnimation(0, animation); animation = new ZoomAnimation(1.1f, 0.9f, Time.FromSeconds(0.5f), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequenceAnimation.AddAnimation(0.5f, animation); this.animationsList.Add(sequenceAnimation); this.Initialize(entity); this.UpdateScaling(); render.Shader.SetUniform("margin", (WIDTH_BORDER - 5f) / this.canevasSprite.Texture.Size.X); render.Shader.SetUniform("outMargin", 2f / this.canevasSprite.Texture.Size.X); render.Shader.SetUniform("radius", RADIUS_BORDER / this.canevasSprite.Texture.Size.X); }