Skip to content

Commit

Permalink
Merge pull request #212 from EagleoutIce/194-steam-for-the-cup
Browse files Browse the repository at this point in the history
194 steam for the cup
  • Loading branch information
EagleoutIce authored Dec 14, 2022
2 parents ecfc60e + 143699e commit a975bd6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
17 changes: 17 additions & 0 deletions doc/tikzpingus-doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,23 @@ \subsubsection{The cup}
\end{tcblisting}
\endsubkeyexplain}

{\def\pingu@color@cup{<cup-color>}
\subkeyexplain{cup}{cup steam}{color}{\pingu@color@cup@steam}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[cup, cup steam=green]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain}

\subkeyexplain{cup}{cup steam shift}{length}{\pingu@x@cup@steam@shift}
\begin{tcblisting}{@}
\begin{tikzpicture}
\pingu[cup, cup steam, cup steam shift=2mm]
\end{tikzpicture}
\end{tcblisting}
\endsubkeyexplain

\subsubsection{The medal}
\showkeyexplain{medal}{color}{pingu@yellow}
\begin{tcblisting}{@}
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

\begin{document}
\begin{preview}
\tikz{\pingu[spear left,staff left raise=-2mm,spear right]}
\tikz{\pingu[cup,cup steam]}
\end{preview}
\end{document}
13 changes: 11 additions & 2 deletions tex/tikzpingus.sty
Original file line number Diff line number Diff line change
Expand Up @@ -1087,18 +1087,27 @@ coordinate[pos=\pinguanglehl] (\pingu@name-head-left);
}
% #region cup
\pingu@create@extra{cup}{%
% extra cup % TODO: as selection
cup/.code = {\pingu@set@extra{cup}{true}\pingu@color{cup}{#1}},
cup/.default = pingu@green,
cup steam/.code = \pingu@color{cup@steam}{#1},%
cup steam/.default = lightgray,%
cup steam shift/.code = \def\pingu@x@cup@steam@shift{#1},%
cup straw/.code = \pingu@color{cup@straw}{#1}%
}{cup straw=\pingu@color@cup}
}{cup straw=\pingu@color@cup,cup steam=\@pingu@none,cup steam shift=0mm}

\def\pingu@draw@eb@cup{%
\pingu@block[rounded corners=.25mm]{\pingu@color@cup} (\pingu@name-belly-center)++(-.325cm,.275cm) to[bend right=2] ++(.5mm,-.675cm) to[bend right=8] ++(.55cm,\z@) to[bend right=2] ++(.5mm,.675cm);
\path (\pingu@name-belly-center)++(0,.275cm) -- (\pingu@name-bill) coordinate[pos=.5,xshift=-2mm] (\pingu@name-cup-straw-outer-angle);
\path (\pingu@name-belly-center)++(-.115cm,.275cm) coordinate (\pingu@name-straw-outer-start);
\pingu@block[rounded corners=.15mm]{\pingu@color@cup@straw} (\pingu@name-straw-outer-start) -- (\pingu@name-cup-straw-outer-angle) -- (\pingu@name-bill) -- ++(.5mm,0) -- ([xshift=.5mm]\pingu@name-cup-straw-outer-angle) -- ([xshift=.5mm]\pingu@name-straw-outer-start) -- cycle;
\pingu@block{\pingu@color@cup} (\pingu@name-belly-center)++(0,.275cm) ellipse [x radius=.325cm,y radius=.5mm];

% TODO: configure opacity
\pgfonlayer{foreground}
\pingu@block[rounded corners=.05mm,opacity=.55]{\pingu@color@cup@steam} (\pingu@name-belly-center)++(1.5mm+\pingu@x@cup@steam@shift,4mm) coordinate(@) to[out=100,in=260] ++(.3mm,3.75mm) -- ++(0.1mm,0) to[out=280,in=80] ([xshift=.1mm]@) -- cycle;
\pingu@block[rounded corners=.05mm,opacity=.55]{\pingu@color@cup@steam} (\pingu@name-belly-center)++(0mm+\pingu@x@cup@steam@shift,3.33mm) coordinate(@) to[out=100,in=260] ++(.2mm,2.75mm) -- ++(0.1mm,0) to[out=280,in=80] ([xshift=.1mm]@) -- cycle;
\pingu@block[rounded corners=.05mm,opacity=.55]{\pingu@color@cup@steam} (\pingu@name-belly-center)++(-1.25mm++\pingu@x@cup@steam@shift,3.65mm) coordinate(@) to[out=100,in=260] ++(.3mm,3.75mm) -- ++(0.1mm,0) to[out=280,in=80] ([xshift=.1mm]@) -- cycle;
\endpgfonlayer
}
% #endregion

Expand Down

0 comments on commit a975bd6

Please sign in to comment.