The HelloWorld. CPP:
Bool HelloWorld: : init () {
if (! LayerColor: : initWithColor (Color4B (255, 255, 255, 255))) {
return false;
}
The Size visibleSize=Director: : getInstance () - & gt; GetVisibleSize ();
//addEdge
Auto edge=edge: : create ();
The edge - & gt; SetPosition (visibleSize. Width/2, visibleSize height/2);
This - & gt; AddChild (edge);
return true;
}
Edge. H:
The class Edge: public Node {
Public:
Virtual bool init ();
CREATE_FUNC (Edge);
};
Edge. CPP:
Bool Edge: : init () {
Node: : init ();
The Size visibleSize=Director: : getInstance () - & gt; GetVisibleSize ();
SetPhysicsBody (PhysicsBody: : createEdgeBox (visibleSize));
SetContentSize (visibleSize);
return true;
}
Error message as shown in figure
Error to jump to the main. CPP
Return the Application: : getInstance () - & gt; The run ();
Before did not add edge is no problem, add after will go wrong,
Could you tell me how to solve? What is going wrong, thank you
CodePudding user response:
Your resource file is in the Resources folder? Don't wrong, pay attention to spelling this folder in the root directory of the project, the images folder directly, don't have any mistakesCodePudding user response:
The solution? Meet the same problemCodePudding user response:
Have misplaced resources!