</code></pre></div></div><p><codeclass="language-plaintext highlighter-rouge">flags</code> argument is optional. Works just like vanilla <codeclass="language-plaintext highlighter-rouge">CreateWin</code> function, but creates a window with <codeclass="language-plaintext highlighter-rouge">MoveOnTop</code> flag if the flags argument is not specified, and allows to set additional flags for the created window. <codeclass="language-plaintext highlighter-rouge">MoveOnTop</code> flag allows the created window to be placed on top of the game interface.</p><hr/><h3class="d-inline-block"id="draw_image"><ahref="#draw_image"class="anchor-heading"aria-labelledby="draw_image"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a><strong>draw_image</strong></h3><pclass="label label-green">sfall.h</p><divclass="language-c++ highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="kt">void</span><spanclass="n">draw_image</span><spanclass="p">(</span><spanclass="n">string</span><spanclass="o">/</span><spanclass="kt">int</span><spanclass="n">artFile</span><spanclass="o">/</span><spanclass="n">artId</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">frame</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">x</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">y</span><spanclass="p">,</span><spanclass="kt">bool</span><spanclass="n">noTransparent</span><spanclass="p">)</span>
</code></pre></div></div><ul><li>displays the specified PCX or FRM image in the active window created by vanilla <codeclass="language-plaintext highlighter-rouge">CreateWin</code> or sfall’s <codeclass="language-plaintext highlighter-rouge">create_win</code> script function</li><li>artFile/artId: path to the PCX/FRM file (e.g. <codeclass="language-plaintext highlighter-rouge">art\\inven\\5mmap.frm</code>), or its FRM ID number (e.g. <codeclass="language-plaintext highlighter-rouge">0x7000026</code>, see specification of the FID format) optional arguments:</li><li><codeclass="language-plaintext highlighter-rouge">frame</code>: frame number, the first frame starts from zero</li><li><codeclass="language-plaintext highlighter-rouge">x/y</code>: offset relative to the top-left corner of the window</li><li><codeclass="language-plaintext highlighter-rouge">noTransparent</code>: pass True to display an image without transparent background</li><li>NOTE: to omit optional arguments starting from the right, call the functions with different <codeclass="language-plaintext highlighter-rouge">sfall_funcX</code> (e.g. <codeclass="language-plaintext highlighter-rouge">sfall_func4("draw_image", pathFile, frame, x, y))</code></li></ul><hr/><h3class="d-inline-block"id="draw_image_scaled"><ahref="#draw_image_scaled"class="anchor-heading"aria-labelledby="draw_image_scaled"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a><strong>draw_image_scaled</strong></h3><pclass="label label-green">sfall.h</p><divclass="language-c++ highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="kt">void</span><spanclass="n">draw_image_scaled</span><spanclass="p">(</span><spanclass="n">string</span><spanclass="o">/</span><spanclass="kt">int</span><spanclass="n">artFile</span><spanclass="o">/</span><spanclass="n">artId</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">frame</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">x</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">y</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">width</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">height</span><spanclass="p">)</span>
</code></pre></div></div><ul><li>displays the specified PCX or FRM image in the active window created by vanilla <codeclass="language-plaintext highlighter-rouge">CreateWin</code> or sfall’s <codeclass="language-plaintext highlighter-rouge">create_win</code> script function</li><li>artFile/artId: path to the PCX/FRM file (e.g. <codeclass="language-plaintext highlighter-rouge">art\\inven\\5mmap.frm</code>), or its FRM ID number (e.g. <codeclass="language-plaintext highlighter-rouge">0x7000026</code>, see specification of the FID format) optional arguments:</li><li><codeclass="language-plaintext highlighter-rouge">frame</code>: frame number, the first frame starts from zero</li><li><codeclass="language-plaintext highlighter-rouge">x/y</code>: offset relative to the top-left corner of the window</li><li><codeclass="language-plaintext highlighter-rouge">width/height</code>: the new width/height to scale the image to. Pass -1 to either width or height to keep the aspect ratio when scaling</li><li>NOTE: to omit optional arguments starting from the right, call the functions with different <codeclass="language-plaintext highlighter-rouge">sfall_funcX</code> (e.g. <codeclass="language-plaintext highlighter-rouge">sfall_func4("draw_image", pathFile, frame, x, y))</code></li><li>if called without <codeclass="language-plaintext highlighter-rouge">x/y/width/height</code> arguments, the image will be scaled to fit the window without transparent background</li></ul><hr/><h3id="get_window_attribute"><ahref="#get_window_attribute"class="anchor-heading"aria-labelledby="get_window_attribute"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a><strong>get_window_attribute</strong></h3><divclass="language-c++ highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="kt">int</span><spanclass="n">sfall_func1</span><spanclass="p">(</span><spanclass="s">"get_window_attribute"</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">winType</span><spanclass="p">)</span>
</code></pre></div></div><p>Alternative form: <codeclass="language-plaintext highlighter-rouge">int sfall_func2("get_window_attribute", int winType, int attrType)</code> Returns the attribute of the specified interface window by the <codeclass="language-plaintext highlighter-rouge">attrType</code> argument.</p><ul><li><codeclass="language-plaintext highlighter-rouge">winType</code>: the type number of the interface window (see <codeclass="language-plaintext highlighter-rouge">WINTYPE_*</code> constants in <codeclass="language-plaintext highlighter-rouge">sfall.h</code>)</li><li><codeclass="language-plaintext highlighter-rouge">attrType</code>: <codeclass="language-plaintext highlighter-rouge">0</code> - checks and returns a value of 1 if the specified interface window is created by the game (same as without the argument) <codeclass="language-plaintext highlighter-rouge">1</code> - X position, <codeclass="language-plaintext highlighter-rouge">2</code> - Y position (relative to the top-left corner of the game screen) <codeclass="language-plaintext highlighter-rouge">3</code> - interface width size, <codeclass="language-plaintext highlighter-rouge">4</code> - interface height size <codeclass="language-plaintext highlighter-rouge">-1</code> - returns an associative array of keys (left, top, right, bottom) and values that define the position of the window rectangle (use standard syntax to access array values, e.g. <codeclass="language-plaintext highlighter-rouge">winRect.top</code>, <codeclass="language-plaintext highlighter-rouge">winRect.bottom</code>)</li><li>returns -1 if the specified attribute cannot be obtained</li></ul><hr/><h3id="get_window_under_mouse"><ahref="#get_window_under_mouse"class="anchor-heading"aria-labelledby="get_window_under_mouse"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a><strong>get_window_under_mouse</strong></h3><divclass="language-c++ highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="kt">int</span><spanclass="n">get_window_under_mouse</span><spanclass="p">()</span>
</code></pre></div></div><ul><li>draws the specified PCX or FRM image in the game interface window, returns -1 on any error</li><li><codeclass="language-plaintext highlighter-rouge">winType</code>: the type number of the interface window (see <codeclass="language-plaintext highlighter-rouge">WINTYPE_*</code> constants in <codeclass="language-plaintext highlighter-rouge">sfall.h</code>) this also takes the value of the flag (0x1000000) to prevent immediate redrawing of the interface window</li><li><codeclass="language-plaintext highlighter-rouge">artFile/artId</code>: path to the PCX/FRM file (e.g. <codeclass="language-plaintext highlighter-rouge">art\\inven\\5mmap.frm</code>), or its FRM ID number (e.g. <codeclass="language-plaintext highlighter-rouge">0x7000026</code>, see specification of the FID format)</li><li><codeclass="language-plaintext highlighter-rouge">x/y</code>: offset relative to the top-left corner of the window</li></ul><p>optional arguments:</p><ul><li><codeclass="language-plaintext highlighter-rouge">frame</code>: frame number, the first frame starts from zero</li><li><codeclass="language-plaintext highlighter-rouge">param</code>: an array which specifies additional parameters, where: index 0 - sprite direction for multi-directional FRM index 1/index 2 - the new width/height to scale the image to. Pass -1 to use the original width/height</li></ul><hr/><h3id="interface_print"><ahref="#interface_print"class="anchor-heading"aria-labelledby="interface_print"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a><strong>interface_print</strong></h3><divclass="language-c++ highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="kt">int</span><spanclass="n">sfall_func5</span><spanclass="p">(</span><spanclass="s">"interface_print"</span><spanclass="p">,</span><spanclass="n">string</span><spanclass="n">text</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">winType</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">x</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">y</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">color</span><spanclass="p">)</span>
</code></pre></div></div><ul><li>displays the text in the specified interface window with the current font. Use vanilla <codeclass="language-plaintext highlighter-rouge">SetFont</code> function to set the font</li><li>returns the count of lines printed, or -1 on any error</li><li><codeclass="language-plaintext highlighter-rouge">text</code>: the text to be printed. Use the <codeclass="language-plaintext highlighter-rouge">\n</code> control character to move text to a new line (example: “Hello\nWorld!”)</li><li><codeclass="language-plaintext highlighter-rouge">winType</code>: the type number of the interface window (see <codeclass="language-plaintext highlighter-rouge">WINTYPE_*</code> constants in sfall.h)</li><li><codeclass="language-plaintext highlighter-rouge">x/y</code>: offset relative to the top-left corner of the window</li><li><codeclass="language-plaintext highlighter-rouge">color</code>: the color index in the game palette. Pass 0 if the text color was previously set by vanilla <codeclass="language-plaintext highlighter-rouge">SetTextColor</code> function It can also take additional flags (via <codeclass="language-plaintext highlighter-rouge">bwor</code>) for displaying text: <ul><li><codeclass="language-plaintext highlighter-rouge">0x0010000</code> - adds a shadow to the text, the ‘textshadow’ compiler constant</li><li><codeclass="language-plaintext highlighter-rouge">0x1000000</code> - prevents immediate redrawing of the interface window, the <codeclass="language-plaintext highlighter-rouge">textdirect</code> compiler constant (works the other way around)</li><li><codeclass="language-plaintext highlighter-rouge">0x2000000</code> - fills the background of the text with black color, the <codeclass="language-plaintext highlighter-rouge">textnofill</code> compiler constant (works the other way around)</li></ul></li><li><codeclass="language-plaintext highlighter-rouge">width</code> (optional): the maximum width of the text. The text will be wrapped to fit within the specified width</li></ul><hr/><h3id="message_box"><ahref="#message_box"class="anchor-heading"aria-labelledby="message_box"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a><strong>message_box</strong></h3><divclass="language-c++ highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="kt">int</span><spanclass="n">sfall_func4</span><spanclass="p">(</span><spanclass="s">"message_box"</span><spanclass="p">,</span><spanclass="n">string</span><spanclass="n">message</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">flags</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">color1</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">color2</span><spanclass="p">)</span>
</code></pre></div></div><p>Creates a dialog box with text and returns the result of pressing the button: 0 - No (Escape), 1 - Yes/Done (Enter). Returns -1 if for some reason the dialog box cannot be created.</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>- message: the text in the dialog box. Use the `\n` control character to move text to a new line (example: "Hello\nWorld!")
- flags: mode flags (see `MSGBOX_*` constants in define_extra.h). Pass -1 to skip setting the flags (default flags are NORMAL and YESNO)
- color1/color2: the color index in the game palette. `color1` sets the text color for the first line, and `color2` for all subsequent lines of text (default color is 145)
</code></pre></div></div><p>Alternative form: <codeclass="language-plaintext highlighter-rouge">int sfall_func6("interface_overlay", int winType, 2, int x, int y, int width, int height)</code>.</p><p>Creates an additional drawing surface above the graphic layer of the specified interface window. All subsequent calls of <codeclass="language-plaintext highlighter-rouge">interface_art_draw</code> and <codeclass="language-plaintext highlighter-rouge">interface_print</code> functions will draw on it.</p><ul><li><codeclass="language-plaintext highlighter-rouge">winType</code>: the type number of the interface window (see <codeclass="language-plaintext highlighter-rouge">WINTYPE_*</code> constants in <codeclass="language-plaintext highlighter-rouge">sfall.h</code>)</li><li><codeclass="language-plaintext highlighter-rouge">mode</code>: 1 - creates a new overlay surface 2 - clears the overlay area or the specified rectangle defined by the <codeclass="language-plaintext highlighter-rouge">x</code>, <codeclass="language-plaintext highlighter-rouge">y</code>, <codeclass="language-plaintext highlighter-rouge">width</code>, <codeclass="language-plaintext highlighter-rouge">height</code> arguments 0 - destroys the created overlay surface (frees up the memory allocated to the surface)</li></ul><hr/><h3class="d-inline-block"id="set_window_flag"><ahref="#set_window_flag"class="anchor-heading"aria-labelledby="set_window_flag"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a><strong>set_window_flag</strong></h3><pclass="label label-green">sfall.h</p><divclass="language-c++ highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="kt">void</span><spanclass="n">set_window_flag</span><spanclass="p">(</span><spanclass="n">string</span><spanclass="n">winName</span><spanclass="o">/</span><spanclass="kt">int</span><spanclass="n">winID</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">flag</span><spanclass="p">,</span><spanclass="kt">bool</span><spanclass="n">value</span><spanclass="p">)</span>
</code></pre></div></div><p>Changes the specified flag for the created script or game interface window.</p><ul><li>winName: the window name, assigned to the window by the <codeclass="language-plaintext highlighter-rouge">CreateWin/create_win</code> function</li><li>winID: the ID number of the interface or script window obtained with the <codeclass="language-plaintext highlighter-rouge">get_window_under_mouse</code> function, or 0 for the current game interface</li><li>flag: the flag to change (see <codeclass="language-plaintext highlighter-rouge">WIN_FLAG_*</code> constants in <codeclass="language-plaintext highlighter-rouge">define_extra.h</code>)</li><li>value: <codeclass="language-plaintext highlighter-rouge">true</code> - set the flag, <codeclass="language-plaintext highlighter-rouge">false</code> - unset the flag</li></ul><hr/><h3id="win_fill_color"><ahref="#win_fill_color"class="anchor-heading"aria-labelledby="win_fill_color"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a><strong>win_fill_color</strong></h3><divclass="language-c++ highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="kt">int</span><spanclass="n">win_fill_color</span><spanclass="p">(</span><spanclass="kt">int</span><spanclass="n">x</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">y</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">width</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">height</span><spanclass="p">,</span><spanclass="kt">int</span><spanclass="n">color</span><spanclass="p">)</span>
</code></pre></div></div><p>Fills the rectangle area of the currently selected script window with the specified color, or clears the window with transparent (index 0) color (call the function without arguments).</p><ul><li><codeclass="language-plaintext highlighter-rouge">color</code>: the color index in the game palette (from 0 to 255)</li></ul></div></div><divclass="search-overlay"></div></div></body></html>