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

  • Home
  • SEARCH
  • 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 4610226
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:06:05+00:00 2026-05-22T01:06:05+00:00

I have a pause button/method(not the greatest but it works). Currently, I am changing

  • 0

I have a pause button/method(not the greatest but it works). Currently, I am changing the opacity of EVERYTHING on screen when it is paused which is not what I want to do but it works(and is a pain). Does anyone have a better way of changing the brightness of everything on screen at the same time?

E.G.
when you pause “Angry Birds”(only game I could think of at the moment) the main scene has a transparent black overlay on it.

Here is my Code

-(void) Pause:(ccTime)delta
{
    Bag.opacity = 150;
    ScoreH.opacity = 150;
    TimerH.opacity = 150;
    leftB.opacity = 150;
    rightB.opacity = 150;
    bg.opacity = 150;
    scoreLabel.opacity = 150;
    timeLabel.opacity = 150;

    [[CCDirector sharedDirector] pause];

    CCLOG(@"Game Paused");
}

Also, most of my sprites come from sprite sheets. I don’t know if that helps.
Any help is greatly appreciated. Thanks in advance!

Wow… I have been looking for an answer for this for about a month and RIGHT after I ask this question I decide to search it again and… I find it.

Please excuse my stupidity…

CCLayerColor* colorLayer = [CCLayerColor layerWithColor:ccc4(0, 0, 0, 100)];
[self addChild:colorLayer z:0];

The first three numbers are “RBG” colors and the last number is opacity.

  • 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-22T01:06:05+00:00Added an answer on May 22, 2026 at 1:06 am

    To put a color overlay on top of a layer just add..

    CCLayerColor* colorLayer = [CCLayerColor layerWithColor:ccc4(0, 0, 0, 128)];
    [self addChild:colorLayer z:0];
    

    The first three numbers are “RGB” colors and the last number is opacity. Each can have a value in range between 0 and 255.

    E.G.

    layerWithColor:ccc4(Red, Green, Blue, Opacity)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Bash shell script in which I would like to pause execution
I currently have a view animating from one part of the screen to another.
I have a button with 3 States Start/Resume/Pause. 1 Is this a good pattern
i have a input tag which is non editable, but some times i need
I have a problem which requires me to parse several log files from a
I'm currently working on some concurrent code that would appear to have a few
Problem I have Telerik TabControl and each tab content is a partial view. Everything
I have a snippet to create a 'Like' button for our news site: <iframe
I have a login.jsp page which contains a login form. Once logged in the
I want to have generalised email templates. Currently I have multiple email templates with

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.