1

I want to create a sprite with my personal image. But when I load the project, I have this error:

OpenGL error 0x0501 in C:\Users\PC\Desktop\Quiz\cocos2d\cocos\renderer\backend\opengl\TextureGL.cpp cocos2d::backend::Texture2DGL::updateData 207 cocos2d: fullPathForFilename: No file found at /cc_2x2_white_image. Possible missing file. 

I tried to reduce the size of my image and I hoped that the program will start with my image but it started by an Hello World default image. My image is stored in the folder Resources of my project and this is the code I used to create my sprite:

#include "GraphicScene.hpp" USING_NS_CC; Scene *GraphicScene::createScene() { auto scene = Scene::create(); auto layer = GraphicScene::create(); scene->addChild(layer); return scene; } bool GraphicScene::init() { if (!Layer::init()) { return false; } auto sprite = Sprite::create("quiz.png"); sprite->setPosition(12, 12); this->addChild(sprite, 0); return true; } 
1

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.