|
123 | 123 | <div class="headertitle"><div class="title">GRAPHPRINT Keyword </div></div> |
124 | 124 | </div><!--header--> |
125 | 125 | <div class="contents"> |
126 | | -<div class="textblock"><div class="fragment"><div class="line">GRAPHPRINT x, y, printable</div> |
| 126 | +<div class="textblock"><div class="fragment"><div class="line">GRAPHPRINT x, y, scale_x, scale_y, printable</div> |
127 | 127 | </div><!-- fragment --><p>Draws text directly onto the graphics framebuffer at <b>pixel coordinates</b>. Unlike <span class="tt">PRINT</span>, <span class="tt">GRAPHPRINT</span> does not use or update the text cursor. Each call is independent.</p> |
128 | | -<hr /> |
129 | | -<h3 class="doxsection"><a class="anchor" id="notes-181"></a> |
130 | | -Notes</h3> |
131 | | -<ul> |
132 | | -<li><span class="tt">(x, y)</span> are <b>pixel coordinates</b> measured from the top-left corner of the screen.</li> |
133 | | -<li><span class="tt">printable</span> is the same syntax accepted by <span class="tt">PRINT</span>: a list of values separated by commas or semicolons.<ul> |
134 | | -<li><b>Strings</b> are rendered literally.</li> |
135 | | -<li><b>Numeric values</b> are converted to their string form.</li> |
136 | | -<li><span class="tt">;</span> continues text without spacing.</li> |
137 | | -<li><span class="tt">,</span> advances to the next tab stop (multiple of text column width).</li> |
138 | | -</ul> |
139 | | -</li> |
140 | | -<li>Text is rendered using the current <b>graphics colour</b> (<span class="tt">GCOL</span>) for the foreground.</li> |
141 | | -<li>The background is always <b>transparent</b>; existing pixels are left unchanged.</li> |
142 | | -<li>The function clips safely against screen edges; partially visible text is drawn correctly.</li> |
143 | | -<li>All 8-bit codes <span class="tt">0x00–0xFF</span> map directly to glyphs, including those redefined with <span class="tt">VDU 23</span>. No UTF-8 decoding is applied.</li> |
144 | | -<li>Each call draws at the specified location only. There is no graphics cursor or scrolling.</li> |
145 | | -</ul> |
146 | | -<hr /> |
147 | | -<h3 class="doxsection"><a class="anchor" id="errors-9"></a> |
148 | | -Errors</h3> |
149 | | -<ul> |
150 | | -<li>An error occurs if <span class="tt">x</span> or <span class="tt">y</span> are not numeric.</li> |
151 | | -<li>An error occurs if <span class="tt">printable</span> is omitted.</li> |
152 | | -</ul> |
153 | | -<hr /> |
| 128 | +<p><span class="tt">x</span> and <span class="tt">y</span> are integer <b>pixel coordinates</b> measured from the top-left corner of the screen. scale_x and scale_y can be an integer or a real number. If you specify 0 for either dimension, the default scale of 1 will be used. <span class="tt">printable</span> is the same syntax accepted by <a class="el" href="PRINT.html">PRINT</a>, a list of values separated by commas or semicolons. * Text is rendered using the current <b>graphics colour</b> (<span class="tt">GCOL</span>) for the foreground. The background is always <b>transparent</b>, existing pixels are left unchanged. Each call draws at the specified location only, there is no graphics cursor or scrolling.</p> |
| 129 | +<p>You can use negative scale values to flip the text. Note that if you flip the scale values, it will render right to left or bottom to top accordingly.</p> |
154 | 130 | <h3 class="doxsection"><a class="anchor" id="examples-174"></a> |
155 | 131 | Examples</h3> |
156 | | -<p><b>Draw a label in magenta</b></p> |
| 132 | +<p><b>Draw a label upside down in magenta</b></p> |
157 | 133 | <div class="fragment"><div class="line">GCOL &FF00FF</div> |
158 | | -<div class="line">GRAPHPRINT 100, 40, "SCORE:", SCORE</div> |
159 | | -</div><!-- fragment --><p><b>Overlay transparent HUD text</b></p> |
| 134 | +<div class="line">GRAPHPRINT 100, 40, 1, -1, "SCORE:", SCORE</div> |
| 135 | +</div><!-- fragment --><p><b>Overlay transparent HUD text at 5x scale</b></p> |
160 | 136 | <div class="fragment"><div class="line">GCOL &FFFFFF</div> |
161 | | -<div class="line">GRAPHPRINT 8, 8, "READY!";</div> |
| 137 | +<div class="line">GRAPHPRINT 8, 8, 5, 5, "READY!";</div> |
162 | 138 | </div><!-- fragment --><p><b>Use a redefined glyph</b></p> |
163 | 139 | <div class="fragment"><div class="line">VDU 23,65,&3C,&7E,&FF,&E7,&FF,&66,&66,&00</div> |
164 | | -<div class="line">GRAPHPRINT 120, 100, "AAAAAAAAAAA"</div> |
165 | | -</div><!-- fragment --><hr /> |
166 | | -<h3 class="doxsection"><a class="anchor" id="see-also-7"></a> |
| 140 | +<div class="line">GRAPHPRINT 120, 100, 10, 10, "AAA"</div> |
| 141 | +</div><!-- fragment --><h3 class="doxsection"><a class="anchor" id="see-also-7"></a> |
167 | 142 | See also</h3> |
168 | 143 | <ul> |
169 | | -<li><a class="el" href="PRINT.html">PRINT</a> - text output in the scrolling text grid.</li> |
170 | | -<li><a class="el" href="GCOL.html">GCOL</a> - set graphics colour (0xRetro RocketGGBB).</li> |
171 | | -<li><a class="el" href="LINE.html">LINE</a> - draw lines (used by <span class="tt">VDU 25</span> in Retro Rocket).</li> |
172 | | -<li><a class="el" href="VDU.html">VDU</a> 23 - redefine character bitmaps used by both <span class="tt">PRINT</span> and <span class="tt">GRAPHPRINT</span>. </li> |
| 144 | +<li><a class="el" href="PRINT.html">PRINT</a> ·</li> |
| 145 | +<li><a class="el" href="GCOL.html">GCOL</a> ·</li> |
| 146 | +<li><a class="el" href="LINE.html">LINE</a> ·</li> |
| 147 | +<li><a class="el" href="VDU.html">VDU 23</a> </li> |
173 | 148 | </ul> |
174 | 149 | </div></div><!-- contents --> |
175 | 150 | </div><!-- PageDoc --> |
|
0 commit comments