ScrollingBackground.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
    void Update()
    {
        float offset = Time.time * scrollSpeed;
        GetComponent<Renderer>().material.SetTextureOffset ("_MainTex", new Vector2 (0, -offset));
    }

Usage Example

Beispiel #1
0
        public virtual void Update(GameTime gameTime)
        {
            étatTactile = TouchPanel.GetState();
            if (étatTactile.Count > 0)
            {
                foreach (TouchLocation location in étatTactile)
                {
                    Point touchLocation = new Point((int)location.Position.X, (int)location.Position.Y);
                    foreach (Bouton bouton in Boutons)
                    {
                        if (bouton.emplacementBouton.Contains(touchLocation))
                        {
                            bouton.Agir();
                        }
                    }
                }
            }

            if (background1.rectangle.Y > fenêtre.Height)
            {
                background1.rectangle.Y = background2.rectangle.Y - background1.texture.Height;
            }
            if (background2.rectangle.Y > fenêtre.Height)
            {
                background2.rectangle.Y = background1.rectangle.Y - background2.texture.Height;
            }

            background1.Update();
            background2.Update();
        }
All Usage Examples Of ScrollingBackground::Update
ScrollingBackground