public override void Setup(float startTime) { background.visible(true); same.visible(true); notSame.visible(true); circle.visible(true); triangle.visible(true); same.setCenterToViewportCoord(0.35f, 0.66f); notSame.setCenterToViewportCoord(0.7f, 0.66f); circle.setCenterToViewportCoord(0.3f, 0.33f); triangle.setCenterToViewportCoord(0.7f, 0.33f); // hide the triangle to start triangle.visible(false); circleCycler = new Cycler(shapeSpeed, 0, startTime); circleCycler.AddSprite(circle); notSameCycler = new DelayedCycler(0.2f, 4, 1.2f, startTime); notSameCycler.AddSprite(notSame); wiggler = new Wiggler(startTime, timeLength, new[] { circle, triangle }); sensor = new TouchSensor(input, gameObjectFinder); shapes = new SpriteCollection(new[] { circle, triangle }, camera, sensor); }
public void show() { textLabel.SetActive(true); messageBackground.visible(true); leftBorder.visible(true); rightBorder.visible(true); topBorder.visible(true); bottomBorder.visible(true); }
private void chooseTail() { if (onRightSide()) { speechBubbleLeft.visible(false); speechBubbleRight.visible(true); } else { speechBubbleLeft.visible(true); speechBubbleRight.visible(false); } }
public override void LoadAssets() { background.LoadAssets(); topHand = Sprite.create(this, "top_hand"); bottomPalm = Sprite.create(this, "hand_base_top"); bottomWrist = Sprite.create(this, "hand_base_bottom"); bottomHandFingers = Sprite.create(this, "bottom_hand_fingers"); indexClosed = Sprite.create(this, "index_closed"); indexOpen = Sprite.create(this, "index_open"); middleFingerOpen = Sprite.create(this, "middle_finger_open"); otherFingerOpen = Sprite.create(this, "other_finger_open"); littleFingerOpen = Sprite.create(this, "little_finger_open"); thumbOpen = Sprite.create(this, "thumb_open"); topHand.visible(false); bottomPalm.visible(false); bottomWrist.visible(false); bottomHandFingers.visible(false); indexClosed.visible(false); indexOpen.visible(false); middleFingerOpen.visible(false); otherFingerOpen.visible(false); littleFingerOpen.visible(false); thumbOpen.visible(false); // second part of the scene: zoomed out fallingGuyProp.LoadAssets(); }
public override void Setup(float startTime) { background = FullScreenQuad.create(this, "bg"); title = Sprite.create(this, new[] { "tmo1", "tmo2", "tmo3", "tmo4", "tmo5", "tmo6" }); subtitle = Sprite.create(this, new[] { "p1", "p2", "p3", "p4", "p5", "p6" }); news = Sprite.create(this, new[] { "news1", "news2" }); buyMusic = Sprite.create(this, new[] { "itunes1", "itunes2" }); startButton = Sprite.create(this, new[] { "tap1", "tap2", "tap3" }); Camera cam = Camera.main; var layoutpos = cam.ViewportToWorldPoint(new Vector3(0.5f, 0.65f, 0.0f)); layoutpos -= title.Center(); // Programmer needs swizzling, badly. title.transform.position = new Vector3(layoutpos.x, layoutpos.y, title.transform.position.z); // Anchor the subtitle an absolute distance from wherever the title ended up subtitle.transform.position = title.transform.position + title.Center() + new Vector3(15f, -20f, -1f); // add blinking start text below title but don't display it yet startButton.setCenterToViewportCoord(0.5f, 0.4f); startButton.visible(false); // place buttons in the bottom corners news.setScreenPosition(4, 4); buyMusic.setScreenPosition((int)Screen.width - buyMusic.PixelWidth() - 4, 4); // animate title cycle_title = new Cycler(0.4f, 5); cycle_title.AddSprite(title); cycle_title.AddSprite(subtitle); }
public override void Setup(float startTime) { background = FullScreenQuad.create(this, "bg"); title = Sprite.create(this, new[] {"tmo1", "tmo2", "tmo3", "tmo4", "tmo5", "tmo6"}); subtitle = Sprite.create(this, new[] {"p1", "p2", "p3", "p4", "p5", "p6"}); news = Sprite.create(this, new[] {"news1", "news2"}); buyMusic = Sprite.create(this, new[] {"itunes1", "itunes2"}); startButton = Sprite.create(this, new[] {"tap1", "tap2", "tap3"}); Camera cam = Camera.main; var layoutpos = cam.ViewportToWorldPoint(new Vector3(0.5f, 0.65f, 0.0f)); layoutpos -= title.Center(); // Programmer needs swizzling, badly. title.transform.position = new Vector3(layoutpos.x, layoutpos.y, title.transform.position.z); // Anchor the subtitle an absolute distance from wherever the title ended up subtitle.transform.position = title.transform.position + title.Center() + new Vector3(15f, -20f, -1f); // add blinking start text below title but don't display it yet startButton.setCenterToViewportCoord(0.5f, 0.4f); startButton.visible(false); // place buttons in the bottom corners news.setScreenPosition(4, 4); buyMusic.setScreenPosition((int) Screen.width - buyMusic.PixelWidth() - 4, 4); // animate title cycle_title = new Cycler(0.4f, 5); cycle_title.AddSprite(title); cycle_title.AddSprite(subtitle); }
public override void Setup(float startTime) { background = spriteRenderer.add(new FullScreenQuad(), this.GetType(), new[] {"bg"}); title = spriteRenderer.add(new Sprite(), this.GetType(), new[] {"tmo1", "tmo2", "tmo3", "tmo4", "tmo5", "tmo6"}); subtitle = spriteRenderer.add(new Sprite(), this.GetType(), new[] {"p1", "p2", "p3", "p4", "p5", "p6"}); news = spriteRenderer.add(new Sprite(), this.GetType(), new[] {"news1", "news2"}); buyMusic = spriteRenderer.add(new Sprite(), this.GetType(), new[] {"itunes1", "itunes2"}); startButton = spriteRenderer.add(new Sprite(), this.GetType(), new[] {"tap1", "tap2", "tap3"}); Camera camera = Camera.main; var layoutpos = camera.ViewportToWorldPoint(new Vector3(0.5f, 0.65f, 0)); layoutpos -= new Vector3(title.Center(), 0); title.worldPosition = new Vector3(layoutpos.X, layoutpos.Y, title.worldPosition.Z); // Anchor the subtitle an absolute distance from wherever the title ended up subtitle.worldPosition = title.worldPosition + new Vector3(title.Center() , 0) + new Vector3(16f, 24f, -1f); // add blinking start text below title but don't display it yet startButton.setCenterToViewportCoord(0.5f, 0.4f); startButton.visible(false); // place buttons in the bottom corners news.screenPosition = new Vector3(4, camera.pixelHeight - news.height - 4, 0); buyMusic.screenPosition = new Vector3(camera.pixelWidth - buyMusic.PixelWidth() - 4, camera.pixelHeight - buyMusic.height - 4, 0); // animate title cycle_title = new Cycler(0.4f, 5); cycle_title.AddSprite(title); cycle_title.AddSprite(subtitle); }
public override void LoadAssets() { mouthLeft = resourceFactory.Create(this, "MouthLeft-WeNeedThisTaste").GetComponent <Sprite>(); mouthRight = resourceFactory.Create(this, "MouthRight-WeNeedThisTaste").GetComponent <Sprite>(); mouthLeft.visible(false); mouthRight.visible(false); }
public override void LoadAssets() { mouthLeft = resourceFactory.Create(this, "MouthLeft-WeNeedThisTaste").GetComponent<Sprite>(); mouthRight = resourceFactory.Create(this, "MouthRight-WeNeedThisTaste").GetComponent<Sprite>(); mouthLeft.visible(false); mouthRight.visible(false); }
private void moveMouth(Sprite mouth, int start, int end) { // combinations of nextTexture and activating/deactivating the mouth overlays if (frame == start) { mouth.visible(true); } else if (frame > start && frame < end) { mouth.DrawNextFrame(); } else if (frame == end) { mouth.DrawNextFrame(); mouth.visible(false); } }
void buildMessageBackground() { messageBackground = Sprite.create((Texture2D)Resources.Load("1px")); messageBackground.visible(false); messageBackground.name = "message background"; messageBackground.transform.position = new Vector3(0f, 0f, -9f); }
private void addMouth() { leftMouth = resourceFactory.Create(this, "LeftMouth").GetComponent <Sprite>(); rightMouth = resourceFactory.Create(this, "RightMouth").GetComponent <Sprite>(); leftMouth.visible(false); rightMouth.visible(false); leftMouth.setWorldPosition(-19f, 25f, -4f); rightMouth.setWorldPosition(22.5f, 24f, -4f); }
private void addMouth() { leftMouth = resourceFactory.Create(this, "LeftMouth").GetComponent<Sprite>(); rightMouth = resourceFactory.Create(this, "RightMouth").GetComponent<Sprite>(); leftMouth.visible(false); rightMouth.visible(false); leftMouth.setWorldPosition(-19f, 25f, -4f); rightMouth.setWorldPosition(22.5f, 24f, -4f); }
private void animateStartButton() { if (cycle_start == null) { cycle_start = new Cycler(0.4f, 2); cycle_start.AddSprite(startButton); startButton.visible(true); } cycle_start.Update(Time.time); }
public void makeFistsWhenTogether(Metronome metronome) { // flap the hands twice per second on the beat if ((leftSideStopped && rightSideStopped) || ((int)(metronome.elapsed(Time.time) * 2f)) % 2 == 1) { guyWithArmOut.visible(true); otherArm.visible(true); otherFist.visible(false); guyWithFist.visible(false); } else { otherFist.transform.position = otherArm.transform.position; guyWithFist.transform.position = guyWithArmOut.transform.position; otherFist.visible(true); guyWithFist.visible(true); guyWithArmOut.visible(false); otherArm.visible(false); } }
public void LoadAssets() { guyWithArmOut = Sprite.create("SceneTwelve/guy_armout"); otherArm = Sprite.create("SceneTwelve/other_arm"); guyWithArmOut.visible(false); otherArm.visible(false); guyWithFist = Sprite.create("SceneTwelve/guy_armout_fist"); otherFist = Sprite.create("SceneTwelve/other_arm_fist"); guyWithFist.visible(false); otherFist.visible(false); }
public override void LoadAssets() { background = FullScreenQuad.create("TitleScene/bg"); background.visible(false); same = Sprite.create(this, "same"); notSame = Sprite.create(this, "notsame", "notsame_caps", "notsame_g1", "notsame_g2"); circle = Sprite.create(this, "circle1", "circle2", "circle3", "circle4", "circle5"); triangle = Sprite.create(this, "triangle1", "triangle2", "triangle3"); same.visible(false); notSame.visible(false); circle.visible(false); triangle.visible(false); }
public SpeechBubble(Camera camera, float leftToRightSwitchOverPosition) { this.camera = camera; this.leftToRightSwitchOverPosition = leftToRightSwitchOverPosition; speechBubble = Sprite.create("SceneFour/bubble"); speechBubbleLeft = Sprite.create("SceneFour/bubble_1"); speechBubbleRight = Sprite.create("SceneFour/bubble_2"); speechBubbleRight.visible(false); speechBubble.setWorldPosition(-80f, 60f, -1f); speechBubbleLeft.setWorldPosition(-55f, 50f, -5f); speechBubbleRight.setWorldPosition(-55f, 50f, -5f); speechBubbleRight.transform.Rotate(Vector3.forward * 5); input = new UnityInput(); dragger = new Dragger(input, speechBubble); }
void buildMessageBackground() { messageBackground = Sprite.create((Texture2D) Resources.Load("1px")); messageBackground.visible(false); messageBackground.name = "message background"; messageBackground.transform.position = new Vector3(0f, 0f, -9f); }
void buildMessageBackground() { messageBackground = spriteRenderer.add(new Sprite(), "1px"); messageBackground.visible(false); messageBackground.setDepth(-8.75f); }
private void moveMouth(Sprite mouth, int start, int end) { // combinations of nextTexture and activating/deactivating the mouth overlays if (frame == start) { mouth.visible(true); } else if(frame > start && frame < end) { mouth.DrawNextFrame(); } else if(frame == end) { mouth.DrawNextFrame(); mouth.visible(false); } }