@Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);

        if(this.SceneManager.getMapBuffer() != null)
        {
            // declare the selected scene
            Scene SelectedScene = this.SceneManager.getCurrentScene();

            // create the game image and get the graphic
            Graphics2D g2d = (Graphics2D) g;

            // Beginn Draw
            this.beginPaint(g2d);
            
            // Draw the Background Image
            if(this.BackgroundImage != null)
            {
                g2d.drawImage(this.BackgroundImage, 0, 0, this.getWidth(), this.getHeight(), null);
            }

            // draw the mapbuffer
            g2d.drawImage(this.SceneManager.getMapBuffer(), SelectedScene.getLocation().getX(), SelectedScene.getLocation().getY(), SelectedScene.getSize().getWidth(), SelectedScene.getSize().getHeight(), null);

            // draw the dynamic elements
            for(GameElement Element : SelectedScene.getGameElements())
            {
                if(Element.getRenderMode() == RenderModes.OnGameDraw)
                {
                    if(Element.getLocation().getX() > 0 && Element.getLocation().getY() > 0 && Element.getLocation().getX() < this.getWidth() && Element.getLocation().getY() < this.getHeight())
                    {
                        Element.renderElement(g2d);
                    }
                }
            }

            // draw the UI
            if(this.UIManager != null)
            {
                this.UIManager.renderContents(g2d);
            }
            
            // End Paint
            this.endPaint(g2d);
        }

    }