

For example, Cocos2d JavaScript Binding (JSB) for C/ C++/ Objective-C is the wrapper code that sits between native code and JavaScript code using Mozilla's SpiderMonkey. Support binding to JavaScript, Lua, and other engines exist for Cocos2D. Features are dependent on the implementation of Cocos2D. Various versions of Cocos2D have audio libraries that wrap OpenAL or other libraries to provide full audio capabilities. Many Cocos2D implementations come with support for common 2D physics engines like Box2D and Chipmunk. This includes things like text boxes, labels, menus, buttons, and other common elements. Some versions of Cocos2D let you also animate particle effects, image filtering effects via shaders (warp, ripple, etc.).Ĭocos2D provides primitives to representing common GUI elements in game scenes. Most Cocos2D implementations let you manipulate the size, scale, position, and other effects of the sprite. They can be chained and composed together to form more complex animations. The sprites can be moved, rotated, scaled, have their image changed, etc.Ĭocos2D provides basic animation primitives that can work on sprites using a set of actions and timers.

Sprites can be manipulated in code based on events or actions or as part of animations.

In Cocos2D, sprites are arranged together to form a scene, like a game level or a menu. A sprite can be thought of as a simple 2D image, but can also be a container for other sprites. There are also many third-party tools, editors and libraries made by the Cocos2d community, such as particle editors, spritesheet editors, font editors, and level editors, like SpriteBuilder and CocoStudio.Īll versions of Cocos2d work using the basic primitive known as a sprite. It contains many branches with the best known being Cocos2d-ObjC (formerly known as Cocos2d-iPhone), Cocos2d-x, Cocos2d-JS and Cocos2d-XNA. The framework offers a wide range of features, including physics, particle systems, skeletal animations, tile maps, and others.Ĭocos2d was first released in 2008, and was originally written in Python. It is written in C++ and provides bindings for various programming languages, including C++, C#, Lua, and JavaScript. Cocos2d is an open-source game development framework for creating 2D games and other graphical software for iOS, Android, Windows, macOS, Linux, HarmonyOS, OpenHarmony and web platforms.
