[Tex/LaTex] How to put the block title at the center in beamer

beamerposterhorizontal alignmenttitles

In my beamer block the title always comes left alined. Is that possible to make the title of the block centered?

\documentclass[final, 12pt]{beamer}    
\usepackage[size=custom,width=120,height=120,scale=1.7,orientation=portrait]{beamerposter} 
\usepackage{ragged2e} 
\usepackage{graphicx} 
\usepackage{lipsum} 
\usepackage{etoolbox} 

\apptocmd{\frame}{\justifying}{}{}

\usebackgroundtemplate{\centering \includegraphics[width=\paperwidth, height=\paperheight]{Figure/LG_PKL.jpg}} 
\addtobeamertemplate{block begin}{\pgfsetfillopacity{0.65}}{\pgfsetfillopacity{1}} 
\addtobeamertemplate{block beamercolorbox begin}{\pgfsetfillopacity{0.65}}{\pgfsetfillopacity{1}}

\newenvironment<>{varblock}[2][\textwidth]{% 
  \setlength{\textwidth}{#1} 
  \begin{actionenv}#3% 
  \def\insertblocktitle{#2}% 
  \par% 
  \usebeamertemplate{block begin}} 
{\par% 
  \usebeamertemplate{block end}% 
  \end{actionenv}}

\usecolortheme{rose}

\begin{document} 

\begin{frame}


\begin{textblock}{}(0.2,1.15)% 
\begin{varblock}[35cm]{\textbf{1. Introduction}} 
\justifying Space for discussion. 
\end{varblock} 
\end{textblock}

\end{document}

Best Answer

Change your definition of varblock to

\newenvironment<>{varblock}[2][\textwidth]{% 
  \setlength{\textwidth}{#1} 
  \begin{actionenv}#3% 
  \def\insertblocktitle{\centering#2\par}% 
  \par% 
  \usebeamertemplate{block begin}} 
{\par% 
  \usebeamertemplate{block end}% 
  \end{actionenv}}