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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:42:56+00:00 2026-06-18T07:42:56+00:00

Using CAEmitterLayer, @2x (retina) images aren’t being scaled property like they do elsewhere in

  • 0

Using CAEmitterLayer, @2x (retina) images aren’t being scaled property like they do elsewhere in iOS. The result I’m getting is the @2x version is being displayed 4x the size of the non-retina image instead of being scaled down.

Any idea of how to fix this? I have tried testing the image pain in a UIImageView and the results are as they should be, so this appears to be a problem with CAEmitterLayer and CAEmitterCell. The images have the correct @2x.png specifier.

Here’s the code I’m using :

CAEmitterLayer *fallingCoinEmitter = [CAEmitterLayer layer];
fallingCoinEmitter.emitterPosition = CGPointMake(self.view.bounds.size.width / 2.0, -30);
fallingCoinEmitter.emitterSize = CGSizeMake(self.view.bounds.size.width * 2.0, 0.0);;

    // Spawn points for the flakes are within on the outline of the line
fallingCoinEmitter.emitterMode  = kCAEmitterLayerOutline;
fallingCoinEmitter.emitterShape = kCAEmitterLayerLine;

    // Configure the snowflake emitter cell
CAEmitterCell *coin = [CAEmitterCell emitterCell];
coin.birthRate      = 8.0;
coin.lifetime       = 5.0;
coin.velocity       = -180;             // falling down slowly
coin.velocityRange = 80;
coin.yAcceleration = 40;
coin.emissionRange = 0.4 * M_PI;        // some variation in angle
coin.spinRange      = 0.45 * M_PI;      // slow spin
coin.contents       = (id) [[UIImage imageNamed:@"Coin_Generic_Emitter"] CGImage];
coin.scale          = 1.0;
coin.scaleRange     = 0.0;

    // Make the flakes seem inset in the background
fallingCoinEmitter.shadowOpacity = 1.0;
fallingCoinEmitter.shadowRadius  = 4.0;
fallingCoinEmitter.shadowOffset  = CGSizeMake(0.0, 3.0);
UIColor *darkGreenColor = [UIColor colorWithRed:0.005 green:0.163 blue:0.005 alpha:1.000];
fallingCoinEmitter.shadowColor   = [darkGreenColor CGColor];
[fallingCoinEmitter setContentsScale:[UIScreen mainScreen].scale];
//fallingCoinEmitter.shouldRasterize = YES;
//[fallingCoinEmitter setRasterizationScale:[UIScreen mainScreen].scale];
//fallingCoinEmitter.scale = fallingCoinEmitter.scale / [[UIScreen mainScreen] scale];

    // Add everything to our backing layer below the UIContol defined in the storyboard
fallingCoinEmitter.emitterCells = [NSArray arrayWithObject:coin];
[self.view.layer insertSublayer:fallingCoinEmitter atIndex:0];

Thanks!

Update:

@Fabian, setting contentScale isn’t working, at least not my solution

    [fallingCoinEmitter setContentsScale:[UIScreen mainScreen].scale];

I also tried this with no results..

    emitter.shouldRasterize = YES;
    [emitter setRasterizationScale:[UIScreen mainScreen].scale];

And settings the scale range did not work. There’s still a difference between the sizes on the iPad 2 and 3 (w RD).

  • 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-06-18T07:42:58+00:00Added an answer on June 18, 2026 at 7:42 am

    You should try modifying your CAEmmitterCells’ scale and scaleRange properties depending on the device’s screen.

    cell.scale = cell.scale / [[UIScreen mainScreen] scale];

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

Sidebar

Related Questions

using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using getDefinitionByName I am consistently getting the error saying it is not defined (as
Using the following as an example (with $db being a previously created database connection
Using the RichTextArea in GWT, It looks like I can only change the font
using grep, vim's grep, or another unix shell command, I'd like to find the
So I have developed an app using CAEmitterLayer. Initially I made it to emit
Using JQuery,Is there any possible to capture images/scanned documents from digital Camera/Scanner Connected to
Using IOS, I am trying to integrate the LinkedIn into the application. The integration
Using Spring MVC, do interceptors only intercept defined controller mappings or can they also
I am new in iOS. I want to use CAEmitterLayer, which is only support

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.