Results 1 to 3 of 3

Thread: Mask of CL_Surface

  1. #1
    Peasant
    Join Date
    May 2008
    Posts
    6

    Default Mask of CL_Surface

    Hi everyone,

    I use a CL_Surface for my sprites, but the color ff00ff or white isn't interpreted as mask. I searched the functions but didn't find.

    I checked the example codes, it should work with CL_Sprites, loaded with ressource classes, but would not yet work with it (experimenting).

    How can I do it?

    Thanks.

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    0.8? Here is a way to do that:

    Code:
    CL_PixelBuffer p = CL_ProviderFactory::load(m_strFilename);
    
    p.set_colorkey(true, CL_Color(255,0,255)); //whatever color should be transparent
    
    CL_Surface mySurf = new CL_Surface(p);
    Seth A. Robinson
    Robinson Technologies

  3. #3
    Peasant
    Join Date
    May 2008
    Posts
    6

    Default

    Thanks!

    I also found that PNG does it automatically (with alpha values used).

Similar Threads

  1. problem with CL_Surface display a PNG
    By lurker2000wxc in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 03-14-2008, 09:18 AM
  2. [Bug ?] Problem with pixel buffer returned by CL_Surface::get_pixeldata
    By LiFo2 in forum Official ClanLib SDK Forums
    Replies: 7
    Last Post: 05-10-2007, 09:23 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •