V3.1.8-introducing the multi-resolution solution, gamepads, sound manager improved

Hey there,

It was about time to provide a new build, isn’t it? We’re proud to share this one with you. It introduces a top gun feature: a solution to manage multi-resolution game on every screen! We’ve also worked on gamepads support, improved the sound manager and many other improvements.

On 11th October, we participated to the Flash Online Conference #6, it introduces the Citrus Engine and present RaveAI 2D which will be added into CE V3.2. The record is here.


  • Starling updated on 1.4.1
  • Feathers updated on 1.1.1
  • DragonBones updated to 2.4
  • Nape updated on 2.0.12
  • Removed Spine runtime support. Use it via DragonBones library (easier to maintain only one skeleton lib).
  • Updated to latest DynamicTextureAtlas extension.
  • StarlingCitrusEngine offers to manage multi-resolutions and test for context3DProfile availability (http://wiki.starling-framework.org/citrus/multi_resolution)
  • ISpriteView handleArtReady/handleArtChanged – custom citrus sprite or physics objects can now react when ‘the view is set (or loaded if the view was a url) or changes to add/remove event listeners, transform the art or manipulate its content
  • Input:
    • justDid,isDoing,hasDone return the corresponding InputAction object or null (instead of just true or false).
    • InputActions carry messages
    • new utility functions such as getAction() with phase/controller/channel filtering.
    • removed backwards compatibility(isPressed…)
    • InputAction’s time property tells how long (in frames) the input action has been active in the input system.
  • Changed the way we handle the physics engine’s debug drawers (due to state transition bugs, and the new nape ShapeDebug) see APhysicsEngine.debugView
  • MathVector : critical bug fixes (rotate and angle returned wrong results) and new methods (dot product, normalize, copyFrom, setTo)
  • Camera :
    • the camera will not follow a target within the area defined by the deadZone rectangle property. (the default deadZone is 0,0,0,0 so the camera constantly follows the target unless its rectangle collides with the bounds
    • the AABB rectangle of the camera is accessible using camera.getRect()
    • camera is disabled by default. calling setUp or setting its enabled property to true will enable it (activate its update calls)
    • added contains(x,y) , containsRect and intersectsRect as a way to know if points/objects are on or off screen and how. for objects, use their visual bounds in state space.
    • the camera updates its cameraLensWidth/cameraLensHeight by listenting to the CitrusEngine onStageResize signal, no need to update it manually now.
    • offset is replaced by “center” which defines the relative position of the camera offset to its width and height. ex: if center is 0.5,0.5 then the offset will be in the middle of the screen (see more info here)
    • added a switchToTarget function to tween the camera movement to a new target’s position with duration and onComplete callback (see the cameramovement example)
  • SoundManager :
    • on stage deactivate, all sounds are paused (because of Air being able to run in background on mobiles)
    • removeAllSounds accepts exceptions, fixed stack underflow error
    • UI sound group added by default.
    • you can preload an entire sound group by calling preloadSounds() on it and listen for the ALL_SOUNDS_LOADED event on that group
    • revamp of the entire system (see below), sounds can be played more than once.
  • AnimationSequence :
    • removeAllAnimations method
    • addTextureAtlasWithAnimations to support AssetManager objects
    • using starling, an animation loaded from a .swf will be transformed into an AnimationSequence using AnimationSequence.fromMovieClip
    • with the flash display list CitrusEngine mode, swfs are wrapped into the new spriteview.AnimationSequence to allow for animation tracking, onAnimationComplete like the starlingview.AnimationSequence – as long as the .fla has the format described in the documentation for spriteview.AnimationSequence or is constructed the same way as patch_character-SpriteArt.fla in the citrus examples.
  • use addEntity instead of add to add entity to state.
  • nape Platform oneWay fixed.
  • box2D Reward fixed (updates by default).
  • Added a LoaderContext for SpriteArt and StarlingArt, we are able to load swf on iOS.
  • Added rotation parameter in TmxObject coming from latest Tiled Map Editor builds.
  • Fixed a bug where using StarlingCitrusEngine we had to set it up directly.
  • state.getObject* functions include results from searches in the pool objects.

We’ve also updated and added articles to the wiki because some new features do require explanations but we can’t go through each of them in this blog post. Have a look!

The citrus engine examples have also been looked at individually to ensure they actually run ok. if you find a bug not listed above please report it!

Make sure you’ve reviewed all elements of the changelog. There are some very important changes that could mean a small part of your project might need updating if you want to upgrade.

if you need help or even have trouble understanding what actually changed and need more details, we welcome questions on the forum and even appreciate any kind of feedback or criticism.

12 thoughts on “V3.1.8-introducing the multi-resolution solution, gamepads, sound manager improved

  1. Thanks for everything ๐Ÿ™‚

    wish you get the appreciation you deserve for the time and effort you put to make Citrus-Engine what it is

  2. Pingback: Flash Platform Rundown โ€“ Week of November 10th, 2013 | In Flagrante Delicto!

  3. Hi, first of all I wanted to say citrus engine is awesome! I’m a bit of a beginner and having an engine so friendly and powerful as this really helps a lot!

    I’m having the same issue with the StarlingState class in the new SWC (not found). Could you please explain how can I fix this? Tried adding the grithub source code in flash builder but some other errors popped up, so I’m not sure that’s what you meant with using the source code. Sorry, I’m a bit noobish haha.

    Thanks again for this incredible engine!!

  4. I’m from 317 to 318, I did have some small problems
    like ”
    Your Main [object Main] class doesn’t extend StarlingCitrusEngine, or you didn’t call its setUpStarling function

    it seems not friendly..
    I really like the new features on 3-1-8

    • i’ve problem like yours . here the solution :

      public class Main extends StarlingCitrusEngine
      public function Main()


      //We have a stage so we can call setup starling
      override protected function handleAddedToStage(e:Event):void


      //starling is ready, we can start a state. You need put new state in this function. Put the a state in Main –> error.
      override public function handleStarlingReady():void
      //load assets etc..

      state = new FirstState();

      //Original post :

  5. the source-code on gitHub and the swc bin files seems not match, I can’t run the source-code on my project;

    I want to initialize the CitrusEngine at any time, but the method initialize() is not possible.

    • Apparently the initialize method wasn’t included in the SWC of the 3-1-8 build. You can place the code in your initialize override function in your constructor function instead for now. It worked to me.

Leave a Reply

Your email address will not be published. Required fields are marked *