Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17070

[SOLVED] App on android only loads certain assets

$
0
0

@EZ64cool wrote:

After compiling my project and getting it onto android i can see 1 of 2 assets on the main menu screen. The assets are in the same place, however one is used for a button and the other is just a sprite.
'''
HEIGHT = cocos2d::Director::getInstance()->getOpenGLView()->getFrameSize().height;
WIDTH = cocos2d::Director::getInstance()->getOpenGLView()->getFrameSize().width;

auto center = cocos2d::CCNode::create();
addChild(center);
center->setPosition(cocos2d::Vec2(WIDTH / 2, HEIGHT / 2));

auto title = cocos2d::CCSprite::create("Assets/PNG/Title.png");
center->addChild(title);
title->setPositionY(200);

auto playBtn = cocos2d::ui::Button::create();
playBtn->setTouchEnabled(true);
playBtn->loadTextures("Assets/PNG/playButton.png", "Assets/PNG/playButton.png", "Assets/PNG/playButton.png");
center->addChild(playBtn);
playBtn->addTouchEventListener(CC_CALLBACK_0(HelloWorld::changeScene, this));

'''
The images are in the resources/res folder, the proj.android/assets/res folder and the proj.android-studio/app/assets/ res folder. Is my code wrong or have i just missed another folder i need to copy, paste my assets into?

Android studio output:
'''
D/cocos2d-x debug info: cocos2d: fullPathForFilename: No file found at Assets/PNG/playButton.png. Possible missing file.
D/cocos2d-x debug info: cocos2d: fullPathForFilename: No file found at Assets/PNG/playButton.png. Possible missing file.
D/cocos2d-x debug info: cocos2d: fullPathForFilename: No file found at Assets/PNG/playButton.png. Possible missing file.
'''

Posts: 6

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 17070


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>