resize_video_canvas(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

✨ resize_video_canvas ✨

okay so bestie, welcome to the Arcan Lua API πŸ’… this is resize_video_canvas(3) and it's literally the glow-up button for your drawing canvas, no cap.


πŸŽ€ NAME πŸŽ€

resize_video_canvas β€” resize the virtual canvas drawing area πŸ–ΌοΈβœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

nil
resize_video_canvas( neww, newh )

🌸 DESCRIPTION 🌸

so by default? the drawing canvas is set to match the video platform's default output display β€” which, btw, is itself controlled by the command-line arguments β€” in a 1:1 ratio. matching, aligned, cute, done. 🫢

but like… what if you're running multiple-screen configurations? or you just want a higher rendering resolution than the default display gives you? that's the whole vibe check this function passes: the canvas can be resized. go bigger, go smaller, live your truth. πŸ”₯


πŸ’œ NOTES πŸ’œ

  1. this will affect any accelerated- mouse cursor as well 😭 β€” its size and projection are related to the ratio between the canvas dimensions and those of the actual main output display. if that behavior is an issue, use resize_cursor instead. it's giving "one thing changes, everything follows."
  2. the global canvas size constants VRESW, VRESH will be changed accordingly. so yeah, the constants are in on it too. πŸ“
  3. if the canvas has previously been destroyed via delete_image(WORLID) this function will restore/reallocate it. undead canvas energy honestly πŸ§Ÿβ€β™€οΈβœ¨
  4. okay so there are two major caveats with setting this property to large values, and we need to talk:
    • one: the canvas is used as a primary rendering target that is then mapped to one or several output displays. but there are, however, hardware limitations on how large such surfaces can be β€” and in such cases, the resize operation will fail silently. πŸ’€ not a single word of complaint. just nothing.
    • two: this can be used to circumvent texture size restrictions through creative use of extpop/extpush contexts and image_sharestorage. if this is an issue, dimension restrictions should be added in this function as well. so like, if that's a problem for you, that's on your function. πŸ‘‘

🌈 EXAMPLE 🌈

function resize_video_canvas0()
      local img_1 = fill_surface(VRESW, VRESH, 255, 0, 0);
      local img_2 = fill_surface(100, 100, 0, 255, 0);
      move_image(img_2, VRESW * 2, VRESH * 2, 400);
      show_image({img_11, img_2});
      resize_video_canvas(VRESW * 4, VRESH * 4);
end

look at her go 😭 iconic behavior fr fr


πŸ™ˆ MISUSE πŸ™ˆ

do NOT do this, bestie:

function resize_video_canvas0()
      resize_video_canvas(1024 * 1024 * 1024, 0);
end

πŸ’€ MISUSE πŸ’€

and absolutely do NOT do this either:

function resize_video_canvas1()
      resize_video_canvas(-1, -1);
end

i'm literally begging you 🫢


🌟 SEE ALSO 🌟


and that's the whole page, bestie πŸŽ€ written by vidsys, dated October 2026 β€” go forth and resize responsibly, ilysm πŸ’–βœ¨

πŸ“¦ where this page comes from