public void RowsAndColumnsAreSetFromInput() { //arrange var pins = StubPins(); var pinSet = StubPinSet(pins); //act var matrix = new DotMatrix(pinSet); //assert Assert.Equal(pins[9], matrix.Row[0]); Assert.Equal(pins[14], matrix.Row[1]); Assert.Equal(pins[8], matrix.Row[2]); Assert.Equal(pins[12], matrix.Row[3]); Assert.Equal(pins[1], matrix.Row[4]); Assert.Equal(pins[7], matrix.Row[5]); Assert.Equal(pins[2], matrix.Row[6]); Assert.Equal(pins[5], matrix.Row[7]); Assert.Equal(pins[13], matrix.Column[0]); Assert.Equal(pins[3], matrix.Column[1]); Assert.Equal(pins[4], matrix.Column[2]); Assert.Equal(pins[10], matrix.Column[3]); Assert.Equal(pins[6], matrix.Column[4]); Assert.Equal(pins[11], matrix.Column[5]); Assert.Equal(pins[15], matrix.Column[6]); Assert.Equal(pins[16], matrix.Column[7]); }
// Use this for initialization void Start() { //Testing Score Stuff lotsOfDots = GameObject.Find("Opening"); scoreboard = lotsOfDots.GetComponent <DotMatrix>(); controller = scoreboard.GetController(); //controller.AddCommand(textCommand); TextCommand textCommand = new TextCommand("Beachfront Tech") { HorPosition = TextCommand.HorPositions.Center, Movement = TextCommand.Movements.MoveLeftAndStop }; controller.AddCommand(textCommand); controller.AddCommand(new PauseCommand(5f)); controller.AddCommand(new ClearCommand() { Method = ClearCommand.Methods.MoveRight }); // }
public void CanTurnOnAllColumns() { //arrange var pins = StubPins(); var pinSet = StubPinSet(pins); var matrix = new DotMatrix(pinSet); //act matrix.SetAllColumns(PowerValue.On); //assert for (var x = 0; x < 8; x++) { Assert.Equal(PowerValue.On, matrix.Column[x].Power); } }
void Start() { // Create new DotMatrix display from prefab GameObject dotMatrixObject = (GameObject)(Instantiate(dotMatrixPrefab)); dotMatrixObject.transform.parent = this.transform; dotMatrixObject.transform.localPosition = Vector3.zero; // Get main script DotMatrix dotMatrix = dotMatrixObject.GetComponent <DotMatrix>(); // Set desired values, these can be changed as long as DotMatrix is not initialized by calling Init or by getting reference to Controller/DisplayModel spriteBasedDisplay = (Display_Sprite)(dotMatrix.GetDisplay()); spriteBasedDisplay.WidthInDots = 120; spriteBasedDisplay.HeightInDots = 11; spriteBasedDisplay.OffColor = new Color(0.0f, 0.1f, 0.0f); spriteBasedDisplay.OnColor = new Color(0.1f, 0.8f, 0.1f); spriteBasedDisplay.DotSize = Vector2.one * 0.65f; // This will also init the display (create dots) Controller controller = dotMatrix.GetController(); // Set default font for all text commands controller.DefaultTextFont = TextCommand.Fonts.Large; // Show this text once (no repeat) controller.AddCommand(new TextCommand("This didn't exist in editor but was created from prefab") { Movement = TextCommand.Movements.MoveLeftAndPass, // Move from right to left until away from display FixedWidth = false // Use variable width font }); // Repeat this text forever controller.AddCommand(new TextCommand("The quick brown fox jumps over the lazy dog ---- ") { Movement = TextCommand.Movements.MoveLeftAndStop, // Move from right to left and end when text have reached it's wanted horizontal position HorPosition = AbsCmdPosition.HorPositions.Right, // Align text to right so it will move fully visible when moving from right to left FixedWidth = false, // Use variable width font Repeat = true // Repeat so same text will scroll forever without noticeable stops }); // Change display color before running above text command again controller.AddCommand(new CallbackCommand(SetRandomColor) { Repeat = true }); }
void Start() { DotMatrix dotMatrixDisplayInScene = Object.FindObjectOfType <DotMatrix>(); Controller controller = dotMatrixDisplayInScene.GetController(); for (int tenthOfSecondsInTimer = 1200; tenthOfSecondsInTimer > 0; tenthOfSecondsInTimer--) { controller.AddCommand(new TextCommand(getTextForDisplay(tenthOfSecondsInTimer)) { HorPosition = TextCommand.HorPositions.Right }); controller.AddCommand(new PauseCommand(0.1f)); } controller.AddCommand(new TextCommand("BOOM!") { HorPosition = TextCommand.HorPositions.Center }); controller.AddCommand(new CallbackCommand(endOfTime)); }
void Start() { // Just another way (compared to other examples) to get reference to DotMatrix object this script wants to control DotMatrix dotMatrix = GameObject.Find("/Frozen Counter/DotMatrix_Sprite").GetComponent <DotMatrix>(); controller = dotMatrix.GetController(); controller.AddCommand(new TextCommand("Frozen") { Movement = TextCommand.Movements.MoveLeftAndStop, HorPosition = AbsCmdPosition.HorPositions.Center, DotsPerSecond = 15f }); controller.AddCommand(new PauseCommand(2f)); controller.AddCommand(new TextCommand("and trailing") { Movement = TextCommand.Movements.MoveLeftAndPass, DotsPerSecond = 15f }); counter = 0; }
public void NewGame() { machineAccel = 0.05f; simpleTime = 500; numGem = new System.Random(); //balloonSpawn = numGem.Next(50, 101); balloonSpawn = 100; genesisBalloon = GameObject.Find("SimpleBalloon"); //Testing Score Stuff lotsOfDots = GameObject.Find("DotMatrix_3D"); scoreboard = lotsOfDots.GetComponent <DotMatrix>(); controller = scoreboard.GetController(); TextCommand textCommand = new TextCommand(score.ToString()); controller.AddCommand(textCommand); // machineLoc = this.transform.position; colors = Resources.LoadAll("/", typeof(Material)); BallonList = new List <GameObject>(); isSpawningBallons = true; }