summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikz-among-us/tikz-among-us.sty
blob: a695c69bb59d91612baa90f2cf2ec98dbd53f892 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
% !TeX spellcheck = en_US
% !TeX encoding = UTF-8
% =============================

\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{tikz-among-us}[2020-10-23 Custom Package for my AmongUs sketch -- FHZ -- Version 1.0.1]

\RequirePackage{tikz}
\RequirePackage{xifthen}
\usetikzlibrary{calc}
\usetikzlibrary{shadings}

% =======================================================
% Style 0 -- Original Idea
% =======================================================
\newcommand{\amongUsOriginal}[3][]{%
\begin{tikzpicture}[every path/.style={very thick}]
  % Backpack
  \draw[fill=#2, rounded corners = 3mm] (-0.5,1) rectangle ++(0.8,3.2);
  % Body
  \draw[fill=#2, rounded corners = 3mm] (0,0) -- (0,5)
    arc (124.8074:103.8454:5) arc (80.6307:58.1808:5)-- (3.5,0) -- (2.2,0)
      {[rounded corners = 0mm] -- (2.2,1) coordinate(A) -- (1.2,1)}
        -- (1.2,0) -- cycle;
  % Eyes
  \ifthenelse{\equal{#1}{angry}}
    {\draw[fill=#3]  plot[smooth cycle, tension=.7] coordinates
      {(2.8,4.7) (3.7,4.6) (3.7,3.5) (2.7,3.2) (1.6,3.5) (1.6,4.7)};}
    {\ifthenelse{\equal{#1}{very angry}}
      {\draw[fill=#3]  plot[smooth cycle, tension=.7] coordinates
        {(2.9,4.3) (3.7,4.6) (3.7,3.5) (2.7,3.6) (1.6,3.5) (1.6,4.7)};}
      {\draw[fill=#3]  plot[smooth cycle, tension=.7] coordinates
        {(2.8,4.9) (3.7,4.6) (3.7,3.5) (2.7,3.2) (1.6,3.5) (1.6,4.7)};}
    }
  % Leg detail
  \draw plot[smooth, tension=.7] coordinates {(A) (2.4,1) (2.7,1.1)};
\end{tikzpicture}
}
% *******************************************************

% =======================================================
% Style I
% =======================================================
\newcommand{\amongUsBackpackI}[2][]{%
  \begin{scope}[#1]
    \fill[#2, rounded corners = 3mm] (-0.5,1) coordinate(R1)
      rectangle ++(0.8,3.2) coordinate(R2);

    \fill[black!30!#2, rounded corners = 3mm] (R1) -| ($(R2)+(0,-0.2)$)
      {[sharp corners]-- (-0.5,3.5)} -- cycle;

    \draw[rounded corners = 3mm] (-0.5,1) rectangle ++(0.8,3.2);
  \end{scope}
}
\newcommand{\amongUsBodyI}[2][]{%
  \begin{scope}[#1]
    \fill[black!30!#2, rounded corners = 3mm] (0,0) -- (0,5)
      arc (124.8074:103.8454:5) arc (80.6307:58.1808:5)-- (3.5,0) -- (2.2,0)
      {[rounded corners = 0mm] -- (2.2,1) -- (1.2,1)}
      -- (1.2,0) -- cycle;

    \fill[#2] plot[smooth, tension=.7] coordinates
      {(0.4436,5.2721) (0.5594,2.4257) (1.4347,1.3971)
      (2.9826,1.7343) (3.4666,3.0446) (3.4686,4.0294)
      (3.4797,4.7974) (3.1523,5.2436) (1.9183,5.6907) (1.0265,5.5757)};

    \draw[rounded corners = 3mm] (0,0) -- (0,5)
      arc (124.8074:103.8454:5) arc (80.6307:58.1808:5)-- (3.5,0) -- (2.2,0)
      {[sharp corners] -- (2.2,1) coordinate(A) -- (1.2,1)}
      -- (1.2,0) -- cycle;
    % ----------- Leg detail
    \draw plot[smooth, tension=.7] coordinates {(A) (2.4,1) (2.7,1.1)};
  \end{scope}
}
\newcommand{\amongUsEyesI}[2][]{%
  \begin{scope}[#1]
    \fill[#2] plot[smooth cycle, tension=.7] coordinates
      {(2.8,4.9) (3.7,4.6) (3.7,3.5) (2.7,3.2) (1.6,3.5) (1.6,4.7)};

    \fill[black!50!#2] {plot[smooth, tension=.7] coordinates
        {(1.6,4.7) (1.7964,4.8157) (1.7633,4.3111) (1.9423,3.8301)
        (2.294,3.6464) (2.8087,3.5904) (3.4485,3.5904) (3.7338,3.5723)
        (3.2492,3.2515) (2.0071,3.2661) (1.5208,3.6849) (1.4691,4.3844)}};

    \draw plot[smooth cycle, tension=.7] coordinates
      {(2.8,4.9) (3.7,4.6) (3.7,3.5) (2.7,3.2) (1.6,3.5) (1.6,4.7)};

    \fill[white] plot[smooth cycle, tension=0.7] coordinates
      {(2.8069,4.7316) (3.081,4.7457) (3.3219,4.7029) (3.4541,4.5887)
        (3.2168,4.5055) (2.8152,4.525) (2.668,4.6295)};
  \end{scope}
}
\newcommand{\amongUsI}[3][]{%
  \amongUsBackpackI[#1]{#2};
  \amongUsBodyI[#1]{#2};
  \amongUsEyesI[#1]{#3};
}
% *******************************************************

% =======================================================
% Style II
% =======================================================
\newcommand{\amongUsBackpackII}[2][]{%
  \begin{scope}[#1]
    \draw[shade, top color=#2, bottom color=#2!5!black, middle color=#2,
      rounded corners = 3mm] (-0.5,1) rectangle ++(0.8,3.2);
  \end{scope}
}
\newcommand{\amongUsBodyII}[2][]{%
  \begin{scope}[#1]
    \draw[shade, top color=#2, bottom color=#2!5!black, middle color=#2,
      rounded corners = 3mm]
      (0,0) -- (0,5) arc (124.8074:103.8454:5) arc (80.6307:58.1808:5)
      -- (3.5,0) -- (2.2,0)
      {[sharp corners] -- (2.2,1) coordinate(A) -- (1.2,1)}
      -- (1.2,0) -- cycle;

    \draw plot[smooth, tension=.7] coordinates {(A) (2.4,1) (2.7,1.1)};
  \end{scope}
}
\newcommand{\amongUsEyesII}[2][]{%
  \begin{scope}[#1]
    \draw[shade, inner color=white!95!black, outer color=#2]
      plot[smooth cycle, tension=.7] coordinates
        {(2.8,4.9) (3.7,4.6) (3.7,3.5) (2.7,3.2) (1.6,3.5) (1.6,4.7)};
  \end{scope}
}
\newcommand{\amongUsII}[3][]{%
  \amongUsBackpackII[#1]{#2};
  \amongUsBodyII[#1]{#2};
  \amongUsEyesII[#1]{#3};
}
% *******************************************************

\endinput