public void CreateTapEffect(Box box, float borderThickness) { TrackerBorderBox borderBox = new TrackerBorderBox(box, box.width, box.height, -borderThickness); Vector2 boxPos = effectContainer.OtherToLocal(box, new Vector2()); borderBox.x = boxPos.x; borderBox.y = boxPos.y; borderBox.rotation = box.rotation; borderBox.alpha = 0.35f; borderBox.scale = 1.0f; borderBox.shader = FShader.Additive; borderBox.color = box.player.color.color + new Color(0.3f, 0.3f, 0.3f); //add grey to make it brighter effectContainer.AddChild(borderBox); float growSize = 10.0f; float growScaleX = (borderBox.width + growSize) / borderBox.width; float growScaleY = (borderBox.height + growSize) / borderBox.height; Go.to(borderBox, 0.2f, new TweenConfig() .setEaseType(EaseType.Linear) .floatProp("scaleX", growScaleX) .floatProp("scaleY", growScaleY) .floatProp("alpha", 0.0f) .removeWhenComplete()); }
public void CreateTapEffect(Box box, float borderThickness) { TrackerBorderBox borderBox = new TrackerBorderBox(box, box.width,box.height,-borderThickness); Vector2 boxPos = effectContainer.OtherToLocal(box,new Vector2()); borderBox.x = boxPos.x; borderBox.y = boxPos.y; borderBox.rotation = box.rotation; borderBox.alpha = 0.35f; borderBox.scale = 1.0f; borderBox.shader = FShader.Additive; borderBox.color = box.player.color.color + new Color(0.3f,0.3f,0.3f); //add grey to make it brighter effectContainer.AddChild(borderBox); float growSize = 10.0f; float growScaleX = (borderBox.width+growSize)/borderBox.width; float growScaleY = (borderBox.height+growSize)/borderBox.height; Go.to(borderBox,0.2f,new TweenConfig() .setEaseType(EaseType.Linear) .floatProp("scaleX",growScaleX) .floatProp("scaleY",growScaleY) .floatProp("alpha",0.0f) .removeWhenComplete()); }