Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3405328
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:29:32+00:00 2026-05-18T05:29:32+00:00

I am building an iPad app with Cocos2d. I would like to transform an

  • 0

I am building an iPad app with Cocos2d.

I would like to transform an entire layer (and all its child sprites) to something that appears a little bit x-ray-ish. That is, a black and white image, with the white glowing a bit.

I hope one of you graphics guys has an idea or two. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:29:32+00:00Added an answer on May 18, 2026 at 5:29 am

    Here is how I implemented a dynamic solution that is only a bit x-rayish (I think it is actually more closer to the the inverse of the image). I could not pre-process images, because I had to create the weird image from the current state of the game layer.

    This was all done using Cocos2d:

    1. I created two layers for my scene. One layer is the main game layer, the other layer is an effect layer. The main game layer is subclassed from CCLayer. The effect layer is subclassed from CCColorLayer.

    2. The effect layer is at a higher z-order than the main game layer, that is, the effect layer is above the game layer.

    3. I then used two different blending modes to change the appearance from normal to x-rayish.

    Code-let

    @implementation EffectLayer
    
    - (id) init
    { 
        self = [super init];
    
        if (self != nil)
        {
            self.isTouchEnabled = YES;
            self.color = ccc3(255, 255, 255);
            self.opacity = 0.8;
            [self goNormal];
        }
    
        return self;
    }
    
    - (void) goWeird
    {
        [self setBlendFunc:(ccBlendFunc){GL_ONE_MINUS_DST_COLOR, GL_ZERO}];    
    }
    
    - (void) goNormal
    {
        [self setBlendFunc:(ccBlendFunc){CC_BLEND_SRC, CC_BLEND_DST}];        
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building an iPad app, and would like to use a tiled display with
I'm building an iPad app that will have multiple paper pages and I'd like
I have an iPad app that I would like to make Universal, however this
I'm building an iPad app with views that are split horizontally and animate in
I am building an iPad app that has a split view controller. Is it
I am building a venue layout app for the ipad that will use different
Building an iPad app. I have a button on my main view that I
I am building an iPad app that requires only the middle section of a
I'm interested in building am iPad web app like The GMAIL iPad web app.
I have an iPhone app that I'd like to convert to an iPad app.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.