Leaves of Three Open Source Projects

Check-in [7ab9111cc0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:pixel_robot: Added the `ptn` template tag shortname for dither patterns to the documentation.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7ab9111cc0605c6f03ecc17425d84cbd2733d097d72846f5298d9998d032359e
User & Date: andy 2025-04-21 17:36:44
Context
2025-04-21
17:37
pixel_window: Added sprite_batch and friends (not functioning yet). check-in: 8f0fb2f93b user: andy tags: trunk
17:36
pixel_robot: Added the `ptn` template tag shortname for dither patterns to the documentation. check-in: 7ab9111cc0 user: andy tags: trunk
17:36
pixel_window: Added a method to texture_atlas to find images (node*) by name. check-in: 740d13a011 user: andy tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pixel_robot/doc/tex/patterns.tex.

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
refers (directly or indirectly) to itself will halt script processing
with an error. (\texttt{vpal{[}{]}} does a similar check when a virtual
palette entry is replaced.)

Note that this process only applies when a pattern is \emph{drawn}, not
when its index is placed into an image:

\begin{prCode}[emph={ptn}]
line(..., ptn); // May trigger recursion

// Does not trigger recursion, until the image is rendered. 
vpal[12] = ptn;
line(..., 12);  
\end{prCode}

Pattern indexes placed into the main canvas are \emph{drawn} when the
animation is rendered. Pattern indexes placed into \texttt{Image}s are
\emph{drawn} when the \texttt{Image} is blitted (not stamped) onto the
main canvas or another \texttt{Image}.







|
|


|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
refers (directly or indirectly) to itself will halt script processing
with an error. (\texttt{vpal{[}{]}} does a similar check when a virtual
palette entry is replaced.)

Note that this process only applies when a pattern is \emph{drawn}, not
when its index is placed into an image:

\begin{prCode}[emph={p}]
line(..., p); // May trigger recursion

// Does not trigger recursion, until the image is rendered. 
vpal[12] = p;
line(..., 12);  
\end{prCode}

Pattern indexes placed into the main canvas are \emph{drawn} when the
animation is rendered. Pattern indexes placed into \texttt{Image}s are
\emph{drawn} when the \texttt{Image} is blitted (not stamped) onto the
main canvas or another \texttt{Image}.
221
222
223
224
225
226
227






228
229
230
231
232
233
234
\end{prCode}

  would give a 4 × 4 pattern consisting of alternating horizontal lines.

  The (optional) \texttt{ox,oy} parameters give the origin for the
  pattern's tiling.







  NOTE: \texttt{raw\_sample()} for the dither pattern only ever returns
  0 or 1, never fractional values.

\item
  \texttt{random()} -- Every pixel is a random color from the chosen
  range.








>
>
>
>
>
>







221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
\end{prCode}

  would give a 4 × 4 pattern consisting of alternating horizontal lines.

  The (optional) \texttt{ox,oy} parameters give the origin for the
  pattern's tiling.

  For convenience, the syntax 
\begin{prCode}[emph={name}]
ptn`name`
\end{prCode}
  can be used to easily create a named dither pattern.

  NOTE: \texttt{raw\_sample()} for the dither pattern only ever returns
  0 or 1, never fractional values.

\item
  \texttt{random()} -- Every pixel is a random color from the chosen
  range.