cocos2d::ui::Scale9Sprite with CapInset
cocos2d::ui::Scale9Sprite is very useful when resizing sprites with edge decorations. To set those un-resizable parts, following methods can be used.
Continue readingEverything should be made as simple as possible, but not simpler – Einstein
cocos2d::ui::Scale9Sprite is very useful when resizing sprites with edge decorations. To set those un-resizable parts, following methods can be used.
Continue readingTo get correct resolutions of iPhone 6 and 6 Plus, LaunchImages and IconImages should be correctly set using Asset Catalog
Continue readingWhen overriding cocos2d::Node::setPosition , you have to override setPosition(float x, float y) instead of setPosition(const cocos2d::Vec2& pos) . That’s because of the existence
Continue readingfrom: http://www.nicnocquee.com/2016/01/20/build-cocos2d-x-fat-static-library.html Create a new empty project with targeting cocos2d-x version. Open project with Xcode to set build settings Go
Continue readingTo enable multi-touch support in iOS: CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] pixelFormat: (NSString*)cocos2d::GLViewImpl::_pixelFormat depthFormat: cocos2d::GLViewImpl::_depthFormat preserveBackbuffer: NO sharegroup:
Continue readingfrom: http://discuss.cocos2d-x.org/t/solved-libpng-error-cgbi-unhandled-critical-chunk-xcode-7-3/28001 Set following option in Build Settings: Remove Text Metadata From PNG Files = NO
Continue readingFrom: Cocos2d-x Cookbook by Akihito Matsuura (Packt Publishing, 2015) Using EventDispatcher in cocos2d-x, we can implement Observer Pattern. // initialize, remove
Continue readingUtilize cocos2d-x ShaderTest under cpp-tests. Using SpriteBlur class in the test, following code will add a screenshot with blur effect: void GameLayer::screenshotBlur(float
Continue readingFrom: http://discuss.cocos2d-x.org/t/visibile-size-window-size-etc/10592/4 With introduction of “Design Resolution”, there came various sizes in Cocos2d-x: FrameSize, WindowSize, and VisibleSize. getFrameSize() returns the accessible part
Continue readingGetting screenshot of currently showing scene: Size s= Director::getInstance()->getWinSize(); auto rt= RenderTexture::create(s.width, s.height, Texture2D::PixelFormat::RGBA8888); rt->begin(); Director::getInstance()->getRunningScene()->visit(); rt->end(); Creating a sprite
Continue reading
Recent Comments