Joints in SpriteBuilder 1.1 - cocos2d-iphone

like the post says, I am using SpriteBuilder 1.1.0-rc and I am having a problem with joints. The issue is that I drag the joints into the scene and then I link to the bodies, but when I build the project in Xcode, the joints are not working. I used to do joints by code in SpriteBuilder 1.0, and also in this version, but I want to know how I can do this only with SpriteBuilder, what am I missing?
Some screenshots over here

Related

How do I add an image to my C++ Xcode Project?

I'm trying to make Asteroids using the olcPixelGameEngine. I have a simple triangle sprite for the ship. I want to know how I would "include" this sprite while building. The only way I have found to do this is to place it right next to the binary in the build folder, which I don't want to do because I have read is bad practice.
Can somebody help, please? I am using Xcode 11.4.1

2D vtk Renders in QT

I am unable to do 2D vtk renders in QT without having override errors: Vtk charts break in QT, "no override found for 'vtkContextDevice2D".
While trying to solve this I have been reading about the vtkContextView and vtkGenericOpenGLRenderWindow classes.
vtkGenericOpenGLRenderWindow:
vtkGenericOpenGLRenderWindow provides a skeleton for implementing a render window using one's own OpenGL context and drawable. To be effective, one must register an observer for WindowMakeCurrentEvent, WindowIsCurrentEvent and WindowFrameEvent.
vtkContextView:
This class is derived from vtkRenderViewBase and provides a view of a vtkContextScene, with a default interactor style, renderer etc. It is the simplest way to create a vtkRenderWindow and display a 2D scene inside of it.
I do not understand how the vtkContextView works with OpenGL and was wondering if someone could help explain their relation to one another, and how the context view works.
Also, is there any other way to do 2D vtk renders without the using the context view? I cannot find any exmaples of 2D vtk renders in QT, any advice on how to do 2D renders of vtk in QT will be greatly appreciated.
Current Attempt to render 2D vtk chart:
view->SetRenderWindow(this->qvtkWidgetRight->GetRenderWindow());
view->SetInteractor(this->qvtkWidgetRight->GetInteractor());
Additional Code in main file:
QSurfaceFormat::setDefaultFormat(QVTKOpenGLNativeWidget::defaultFormat());
Additional Info: Win64 on 64bit machine, vtk8.2.0, Qt5.13.0, compiled/built in MCVS2017(Release x64) with cmake3.15.0(3D vtk renders work fine)
Finally figured it out with the help of VTK forums. I simply did not have vtkRenderingContextOpenGL2 in my CMake file(updated code too, had it backwards).

cpCCSprite moving out of Window Containment in cocos 2d Spacemanager framework

I'm new to Cocos2D - spacemanager framework, and stuck at a problem.
I have created a window containment for the gravity using below code..
[spaceManager addWindowContainmentWithFriction:1.0 elasticity:1.0 inset:cpvzero];
Now I created a cpCCSprite object and added it to the CCScene.
I am trying to applyImpulse to this cpCCSprite object when a touch is detected near the sprite.
[sprite applyImpulse:cpvmult(vector, magnitude)];
This works fine when the magnitude is less, but if it is a high value say 1000 or 1500,
the sprite moves out of the window containment added and is disappearing from the screen for the detected touch.
I am using cocos v2.x with spacemanager framework v0.3.0.
Please help me in fixing this.

reveal the contents of a layer through a rectangle "cut-out" with cocos2d?

I am looking for a way to mask out a layer and reveal the contents of the layer through a rectangle (actually I want multiple rectangles to reveal the underlying layer's content).
I came across this similar question:
Cocos2d iPhone - Sprite cliping/mask/frame
Which had a solution:
http://www.learn-cocos2d.com/2011/01/cocos2d-gem-clippingnode/
However, when trying to use this class, I get the warning: "implicit declaration of function 'glPushMatrix' is invalid in C99"... I also get the error: "Property 'deviceOrientation' not found on object of type 'CCDirector *'"
What do I need to do to get this to work with the latest version of cocos2d?
... In any event, I commented out the deviceOrientation stuff, just to test if it will even work, and it doesn't seem to be.
I've got a CCBatchNode:
sheet = [CCSpriteBatchNode batchNodeWithFile:#"bg.png" capacity:500];
Then I add many sprites to that
[sheet addChild:sprite1];
[sheet addChild:sprite2];
[sheet addChild:sprite3];
Then I make the clipping node layer
ClippingNode *clipNode = [ClippingNode node];
clipNode.clippingRegion = CGRectMake(50, 50, 200, 200);
Then I add the sprite sheet and the clipNode:
[layer addChild:sheet];
[layer addChild:clipNode];
Then I add that to the CCSprite object
[self addChild:layer];
...
The result is, I see my many sprites from the sheet, but there is no clipping mask.. And my console shows a million: "OpenGL error 0x0502 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 556"
so..... I am not sure what I am doing wrong-- or if this all has to do with the openGL warnings and device orientation errors... ?
UPDATE: I added #include <OpenGLES/ES1/gl.h> to the ClippingNode.m, and it got rid of the glpush/pop warnings.. But still results in the same OpenGL error once I add the clipNode child to the layer...
You can do it with shaders in cocos2d 2.0. Have a look at this tutorial.
http://www.raywenderlich.com/4428/how-to-mask-a-sprite-with-cocos2d-2-0

Steps to add a cocos2d scene to a UIView

Can anyone say the steps to add cocos2d scene to a uikit project. I am new to cocos2d and not aware how to add the files related to cocos2d and also please explain where to add the eagl view in the ui files.
And also share a link for adding a cocos2d in a uiview and not the other way round.
Thanks
For my mind, it is not a good idea to mix uikit with cocos2d. Examples of creating eaglview you can find in any of cocos2d templates. Here you can read how to install cocos2d templates.
http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:lesson_1._install_test