Buttons.MainScreen.btn_Pressed C# (CSharp) Method

btn_Pressed() public method

public btn_Pressed ( Component source ) : void
source Component
return void
        public void btn_Pressed(Component source)
        {
            if (ball == null)
            {
                ball = new Button(ResourceManager.CreateImage("ball"), ResourceManager.CreateImage("ballpressed"));
                ball.Pivot = Vector2.One / 2;
                AddComponent(ball, Preferences.ViewportManager.VirtualScreenWidth / 2, Preferences.ViewportManager.VirtualScreenHeight / 5, BodyShape.SQUARE, BodyType.DYNAMIC, Category.Cat1);
                ball.Draggable = true;
                ball.Released += new Component.ComponentEventHandler(ball_Released);
            }
        }