Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Extremely laggy when using surface

A topic by Cole Beernaerts created 48 days ago Views: 56 Replies: 4
Viewing posts 1 to 5

Hi, 

I tried using this in a game using the window_shape_create_rectangles_from_surface() function with a surface I created previously and it seemed to completely lag out my machine when the game was running. It worked with the mask I gave it but was completely unusable. I'm not sure what I may have done wrong. 

I ensured it only ran once to create the surface, the shape, and to set it to the window and have tried a lot of debugging on it. 

Currently using IDE v2024.4.1.152, Runtime v2924.4.1.202, built for windows VM

using other shapes like ellipses works perfectly fine. I'm currently resorting to converting vector assets to polygons via arrays, but I'd hope to be able to use sprites. 

I also noticed large amounts of lag when I used window_shape_create_polygon_from_array() to create the polygon with an array size of 364. Is that too much? 

Developer(+1)

If you’re setting the shape once, it should be okay, but the Microsoft documentation doesn’t explicitly say anything about supposed limits of the window shape system.

For sufficiently large and complex shapes you might want to use chromakey or per-pixel alpha instead.

Ok I'll check it out and let you know

The chromakey option works great, thanks! 

It worked with my original vector image but this time I applied some dithering to the edges