# "display" shape for flowchart with tikz

How can I draw this shape with tikz?

• The are many different ways. Technically, "shape" refers to a typle of node and use \pgfdeclareshape on page 1034 of the TikZ manual, although I doubt that is what you want. Apr 23 '18 at 20:56
• Possibly related tex.stackexchange.com/questions/366802
– user30471
Apr 23 '18 at 21:32
• Do you just want to draw this figure, or declare a "new" shape? And why did you tag your question tikz-styles?
– user121799
Apr 23 '18 at 21:48
• My question was not precise -- actually I wanted to ask how to declare the shape! Apr 26 '18 at 5:45

This is a solution using pgfdeclareshape to the shape display

\documentclass[tikz, border = 5pt]{standalone}

\usetikzlibrary{shapes}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}

\makeatletter

\pgfdeclareshape{display}
{
\inheritsavedanchors[from=rectangle] % this is nearly a rectangle
\inheritanchorborder[from=rectangle]
\inheritanchor[from=rectangle]{north}
\inheritanchor[from=rectangle]{west}
\inheritanchor[from=rectangle]{east}
\inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{center}
\inheritbackgroundpath[from=rectangle]
\backgroundpath{
% points
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
% dimensions
\pgfmathsetlength{\pgfutil@tempdima}{\pgf@xb-\pgf@xa}
\pgfmathsetlength{\pgfutil@tempdimb}{\pgf@yb-\pgf@ya}
% path
\pgfpatharc{90}{-90}{0.2\pgfutil@tempdima and 0.5\pgfutil@tempdimb}
\pgfpathclose
}
}

\makeatother

\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width = 4.5em, text badly centered, node distance = 3cm, inner sep = 0pt]
\tikzstyle{block} = [rectangle, draw, fill = blue!20,
text width = 5em, text centered, rounded corners, minimum height = 4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{disp} = [display, draw, fill = cyan!20,
text width = 5em, text centered, minimum height = 4em]

\begin{document}

\begin{tikzpicture}[node distance = 4cm, auto]
% nodes
\node [block] (init) {Think of picture};
\node [disp, right of = init] (display) {Draw picture};
\node [decision, below of = init] (question) {Did they guess it?};
\node [block, right of = question] (no) {Point repeteadly to the same picture};
\node [block, left of = question] (yes) {You win!};
% edges
\path [line] (init) -- (display);
\path [line] (init) -- (question);
\path [line] (question) -- (no) node[midway, fill = white]{No};
\path [line] (question) -- (yes) node[midway, fill = white, above]{Yes};
\path [line] (no.south) -- ++(0, -1cm) -| (question.south);
%
\node[above = 0.5cm of init] {How to play Pictionary};
\end{tikzpicture}

\end{document}


The issue can be solved by removing the last two pathlines from the declareshape block:

\pgfdeclareshape{display}
{
\inheritsavedanchors[from=rectangle] % this is nearly a rectangle
\inheritanchorborder[from=rectangle]
\inheritanchor[from=rectangle]{north}
\inheritanchor[from=rectangle]{west}
\inheritanchor[from=rectangle]{east}
\inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{center}
\inheritbackgroundpath[from=rectangle]
\backgroundpath{
% points
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
% dimensions
\pgfmathsetlength{\pgfutil@tempdima}{\pgf@xb-\pgf@xa}
\pgfmathsetlength{\pgfutil@tempdimb}{\pgf@yb-\pgf@ya}
% path