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 6702489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:03:36+00:00 2026-05-26T07:03:36+00:00

ok so i have the following code : CCScene * timerLayer = [CCScene node];

  • 0

ok so i have the following code :

CCScene * timerLayer = [CCScene node];
[timerLayer setContentSize:CGSizeMake(50, 36)];
timerLayer.position = ccp(100, 260);
if(![self getChildByTag:777]){
    [self addChild:timerLayer z:20 tag:777];
}


timerGraphic = [CCSprite spriteWithFile:@"timer_small.png"];
timerGraphic.position = ccp(0,0);
timerLayer.contentSize = CGSizeMake(50, 36);

if(![timerLayer getChildByTag:779]){
    [timerLayer addChild:timerGraphic z:19 tag:779];
}

as you can see, I am making a timerLayer Scene, and I have resized the the scene to 50x, 36y. and I also have timerGraphic, and I just want to show 50x 36y of this sprite so i tried resizing the scene, but its not working… its showing the entire image all together!

  • 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-26T07:03:37+00:00Added an answer on May 26, 2026 at 7:03 am

    The CCScene node can not be used to clip images. You can either use a Clipping Node or in your case simply change the texture rect to only display that part of the image that’s inside the rectangle:

    [timerGraphic setTextureRect:CGRectMake(0, 0, 50, 36)];
    

    Note: be sure that the rect is within the image’s bounds!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code in my application. [self.navigationController pushViewController:x animated:YES]; It will push a
I have following code: class EntityBase (object) : __entity__ = None def __init__ (self)
i have following code <div class=caption style= position:absolute; margin-top:0px> <img src=caption/img1.png /> </div> <script>
I have following code snippet: self.xmlHttpReq = new XMLHttpRequest(); self.xmlHttpReq.onreadystatechange = function() { if(self.xmlHttpReq.readyState
I have following code in my django application. class Status(object): def __init__(self, id, desc):
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have following Code Block Which I tried to optimize in the Optimized section
I have following code in my application: // to set tip - photo in
I have following code in my Application. Comments in my code will specify My
I have following code class User attr_accessor :name end u = User.new u.name =

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.