setColorKey method
Set the color key (transparent pixel) in a surface.
The color key defines a pixel value that will be treated as transparent in a blit. For example, one can use this to specify that cyan pixels should be considered transparent, and therefore not rendered.
It is a pixel of the format used by the surface, as generated by SDL_MapRGB().
\param surface the SDL_Surface structure to update. \param enabled true to enable color key, false to disable color key. \param key the transparent pixel. \returns true on success or false on failure; call SDL_GetError() for more information.
\threadsafety This function can be called on different threads with different surfaces.
\since This function is available since SDL 3.2.0.
\sa SDL_GetSurfaceColorKey \sa SDL_SetSurfaceRLE \sa SDL_SurfaceHasColorKey
extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, bool enabled, Uint32 key)
{@category surface}
Implementation
bool setColorKey(bool enabled, int key) =>
sdlSetSurfaceColorKey(this, enabled, key);