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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:18:02+00:00 2026-05-24T10:18:02+00:00

I am scaling my sprite object in cocos2d using the CCScaleTo method. It is

  • 0

I am scaling my sprite object in cocos2d using the CCScaleTo method. It is not perfect scaling so I use this code:

id action1=[CCScaleTo actionWithDuration:0.5 scale:1.25];
id action2=[CCScaleBy actionWithDuration:0.5 scale:.25];
id action3=[CCScaleTo actionWithDuration:0.5 scale:1.25];
id action4=[CCScaleTo actionWithDuration:0.5 scale:.25];

[timeUpImg runAction:[CCSequence actions:action1,action2,action3,action4,nil]];

This is working perfectly.

I don’t know the difference between ccScaleBy and CCScaleTo and also how to use the “reverse” method. Can someone explain it please?

  • 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-24T10:18:03+00:00Added an answer on May 24, 2026 at 10:18 am

    CCScaleTo scales the node/sprite to an absolute scale factor while CCScaleBy scales it by a factor relative to current scale.

    For example, suppose a node currently has scale 0.25:

    • [CCScaleTo actionWithDuration:0.5 scale:2.0] will modify the scale to 2.0 (simply ignores the current scale)

    • [CCScaleBy actionWithDuration:0.5 scale:2.0] will modify the scale to 0.5 (0.25 * 2.0)

    On the second question, the reverse method returns an instance of CCAction subclass that gives the reverse effect of the original action. For example: [[CCScaleBy actionWithDuration:0.5 scale:2.0] reverse] will return [CCScaleBy actionWithDuration:0.5 scale:0.5], and [[CCScaleBy actionWithDuration:0.5 scale:4.0] reverse] will return [CCScaleBy actionWithDuration:0.5 scale:0.25]

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

Sidebar

Related Questions

I'm having a problem with image scaling. When I use the following code to
i am scaling UIView using [UIView setTransform:CGAffineTransformMakeScale(2.0*scale.value, 2.0*scale.value)]; its works fine for me but
While scaling a panel using a scale transform the application needs to reset the
I am scaling images by myself using the following codes. The code is fine
When I'm using the SpriteBatch.Draw() method I can get vertical or horizontal scaling. For
Does scaling the image using: image=[UIImage imageWithCGImage:[image CGImage] scale:2.0 orientation:UIImageOrientationUp]; reduces the image quality?
We use Auto Scaling and it works pretty good for us, but this morning
I am scaling UILabel text using UIPinchGestureRecognizer. But I am not able achieve the
According to the docs , using the CENTER attribute will not perform any scaling
This does not work: CCSprite *testscale=[CCSprite spriteWithSpriteFrame:starFrame]; testscale.scale=0.5; float starWidth=testscale.contentSizeInPixels.width; CCLOG(@contentpixels: %f contentsize: %f,starWidth,

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.