Quantcast
Channel: cocos2d-x - Cocos Forums
Viewing all 2747 articles
Browse latest View live

v3.10 and Long Compile Times

$
0
0

@pococogames wrote:

Hi all. I was using cocos2d-x 3.4 before 3.10. But I'm waiting so long when I want to run project on mac with 3.10. I think, this problem has to do with not precompiled projects.

My questions.
1- How I create precompiled project with cocos console? I can always create not precompiled project now.

2- If I can't do that, how can I run project more fast.

Target device: Mac osx
3.4 Compile Time: 10-15 seconds
3.10 Compile Time: 2-3 minutes

Thanks.

Posts: 3

Participants: 2

Read full topic


Issue with ant when compiling cocos2d project

How to convert a number into indian format

$
0
0

@jdboss wrote:

hello,
i need to convert numbers into indian format e.g. if 10000 then in indian format as 10,000 .
so i want it to display amount in indian format like above example
please help me to do this
thanks in advance
please reply as soon as possible

Posts: 2

Participants: 2

Read full topic

How to get suggestions using Android Studio

$
0
0

@Dhiraj0116 wrote:

How to get suggestions in Android Studio?
Like what all things a director can do or what all methods can be applied to a sprite.
I get the suggestion for methods that have already been used by me.
I can't explore all the methods that can be used.
I get the suggestions using Visual Studio but using Android Studio.

Posts: 1

Participants: 1

Read full topic

Android NDK r11c

$
0
0

@lpocay wrote:

Is there a problem with NDK r11c? when i run setup.py to create the PATH variables it said that the root PATH to my ndk is wrong... im using v3.11, all the others PATH variables are fine just the NDK_ROOT that it doesnt work

Posts: 6

Participants: 3

Read full topic

Black screen on cocos2d "Hello World" example + Other beginning questions

$
0
0

@cubby208 wrote:

So I built the "Hello World" example on two of my android devices. I believe the goal of it is to display the logo and the text "Hello World". However on all my devices it just displayed a black screen, I didnt get a crash, or anything in the consoles (Though to be honest I am super overwhelmed by all of the various console's that is is quite possible I missed it). The app is just a black screen right now. Any ideas?

Also where is the "HelloWorld.png" stored in the folder tree?

Also the documentation for cocos is fantastic! However I was wondering if their was a quick reference guide floating around that lists all the functions an properties of the main cocos2d classes. For some reason the intelligent typing helper isn't kicking in and helping me out.

Posts: 6

Participants: 4

Read full topic

How to set image as scale to fill,aspect fit,scale to fit etc properties

$
0
0

@jdboss wrote:

how to set image as scale to fill,aspect fit,scale to fit etc properties?
how to set full image in rect as i don't know how to make it
please reply fast
its urgent

Posts: 2

Participants: 2

Read full topic

Moving to Cocos2D-X, some newbie questions

$
0
0

@TMSantos wrote:

Hello guys,

I decided to give it a try and I would like to ask you few newbie questions.

I see a lot Cocos2D versions, cocos2D-X , cocos2D-JS ,Cocos2D-iPhone, etc, is the only difference the programming language? Are they compatible with each other? Or they are different things with different features? If yes what are the limitations of each one? And in terms of performance? For example why do we have Cocos2D-iPhone if Cocos2d-x can deploy to iOS?

I am planning to use cocos2D-X with C++, and I see a lot stuff that is confusing me where to start, such as:
-Cocos2D creator - is this compatible with normal cocos2D-x projects? Or using this creator requires full dependency on it? Is it production ready?
-SDKBOX - same questions here.

I plan to use C++ language, to take full effort of cocos2D capabilities, should I use this tools? I see so many different paths that I am trying to understand it properly before starting smile

Thank you guys.

Posts: 2

Participants: 2

Read full topic


Why is the "cpp-empty-test" cocos test empty?

$
0
0

@cubby208 wrote:

Ok so I have ran the cpp-test on my device, and it runs wonderfully and draws stuff on the screen. However that is not a good template to work off of becuse their is sooo muuucchh code! So i decided to run the "cpp-empty-test" and it ends up launching a completely blank screen on the device!! Here is its scene code where it clearly adds stuff to the scene.

include "HelloWorldScene.h"

include "AppMacros.h"

USING_NS_CC;

Scene* HelloWorld::scene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();

// 'layer' is an autorelease object
HelloWorld *layer = HelloWorld::create();

// add layer as a child to scene
scene->addChild(layer);

// return the scene
return scene;

}

// on "init" you need to initialize your instance
bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !Layer::init() )
{
return false;
}

auto visibleSize = Director::getInstance()->getVisibleSize();
auto origin = Director::getInstance()->getVisibleOrigin();

/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
//    you may modify it.

// add a "close" icon to exit the progress. it's an autorelease object
auto closeItem = MenuItemImage::create(
                                    "CloseNormal.png",
                                    "CloseSelected.png",
                                    CC_CALLBACK_1(HelloWorld::menuCloseCallback,this));

closeItem->setPosition(origin + Vec2(visibleSize) - Vec2(closeItem->getContentSize() / 2));

// create menu, it's an autorelease object
auto menu = Menu::create(closeItem, nullptr);
menu->setPosition(Vec2::ZERO);
this->addChild(menu, 1);

/////////////////////////////
// 3. add your codes below...

// add a label shows "Hello World"
// create and initialize a label

auto label = Label::createWithTTF("Hello World", "fonts/arial.ttf", TITLE_FONT_SIZE);

// position the label on the center of the screen
label->setPosition(origin.x + visibleSize.width/2,
                        origin.y + visibleSize.height - label->getContentSize().height);

// add the label as a child to this layer
this->addChild(label, 1);

// add "HelloWorld" splash screen"
auto sprite = Sprite::create("HelloWorld.png");

// position the sprite on the center of the screen
sprite->setPosition(Vec2(visibleSize / 2) + origin);

// add the sprite as a child to this layer
this->addChild(sprite);

return true;

}

void HelloWorld::menuCloseCallback(Ref* sender)
{
Director::getInstance()->end();

if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)

exit(0);

endif

}

Where in a cocos2d project is the starting scene decided?

Posts: 3

Participants: 1

Read full topic

How to set game progress bar in v2.9

$
0
0

@jdboss wrote:

i have no idea how to set level progress bar in v 3.9.
how to set progress timer type??
please reply fast
thanks in advance

see snippet above
please reply as soon as possible

Posts: 1

Participants: 1

Read full topic

Quick question about android studio and cocos

$
0
0

@cubby208 wrote:

Ok, So I understand that cocos2d does not perfectly work in Android studio, however you can do everything by using the cocos compiler. I was just hoping someone could match these events to which tool does them.

A. Android studio
B. Commands (with cocos I presume) in command prompt compiler
C. Windows explorer, and text editing tools

  1. Editor for your c++ code files
  2. Compiler of the cocos part of the project
  3. Compiler of the android part of the project
  4. Thing that deploys project to your android device
  5. Thing that monitors project running on android device

An answer could look like, and explanations would be appreciated.

1->A
2->B
3->B
4->C
5->A

And is this still the best tutorial, if there is a written one somewhere that woud be preferred.

Posts: 1

Participants: 1

Read full topic

Is this a breakpoint

Between object in two cameras, how are they shoot, the position how to compute?

$
0
0

@rickystone wrote:

hi guys, i meet one question, i have an object(Gun) in A camera, and anthoer object(Monster) in B camera. if i want to shoo the monster, how can i make the bullet fly to the monster? becuase gun and monster in differenct camera. all camera are perspective.
thanks:)

Posts: 5

Participants: 2

Read full topic

X-studio365(A more powerful game develop tool, support ParticleSystem Editing, UI Editing, Spine animation preview, etc)

$
0
0

@halx99 wrote:

x-studio365 is a game develop tool based on cocos2d-x;It support Particle editing,Scene(UI) editing,Screen Adapting preview, Download the latest version: http://x-studio365.com/intro.html
cocos2d-x version: 3.10, spine runtime version: 3.1

pitfall: If restart required when installing, just ignore it.

Editor main functions:
1. Using cocos2d-x to render the main editor UI directly.
2. Supports more than 20 1K layout methods.
3. Supports ParticleSystem Editing.
4. Supports view real adpating vision for any-size devices.
5. Supports import CocosStudio ccs project file.
6. Supports import .csb, and publish designed ui to cocosstudio(ccs), json, csd formats.
7. Integrated AES batch encrypt/decrypt tool which work on CBC mode, MD5 checksum.
8. Supports Chinese and English.
9. Supports SpriteSheet creation.
remark: It's not support Timeline Editing currently.

Posts: 1

Participants: 1

Read full topic

Child node from c3t file not displayed

$
0
0

@Glidos wrote:

I have a Blender model that I've previously exported as a POD file and used in cocos2d-iphone. To use it in cocos2d-x I've exported it as an fbx file and then converted it to c3t. The model has a hierarchy of nodes: a main body node with two child nodes. The body has a mesh, one of the children also has a mesh. The other child is a skeleton. When I load and display the model via cocos2d-x I can see the body mesh but not the child one. Is that to be expected? Is there any easy way to make it include the child? Here's the c3t file:

c3t file with missing content in cocos2d-x

Posts: 1

Participants: 1

Read full topic


Background not filling screen

$
0
0

@cubby208 wrote:

I am just trying to add a background, how come this is not working? Instead it is shifted slightly lower then it should be in the scene.

auto visibleSize = Director::getInstance()->getVisibleSize();
Vec2 origin = Director::getInstance()->getVisibleOrigin();
width = visibleSize.width;
height = visibleSize.height;

auto background = Sprite::create("HelloWorld.png");
background->setPosition(Vec2(width / 2.0, height / 2.0));
scaleSpriteTo(background, width, height);
background->setAnchorPoint(Vec2(0.5, 0.5));
this->addChild(background);

void scaleSpriteTo(Sprite *it, float xscale, float yscale)
{
it->setScale(xscale / it->getContentSize().width, yscale / it->getContentSize().height);
}

Posts: 1

Participants: 1

Read full topic

Error C3130: Internal Compiler Error: failed to write injected code block to PDB

$
0
0

@Kazai wrote:

Cocos2d-x v3.6. This is error appear on build mode Release(Visual Studio 2013). It's an old error, someone suggest change 'Debug Information Format' to C7 compatible(/Z7) to resolve.
But in mode /Z7 I can NOT run Performance and Diagnostics.

Anyone has solution for this problem?

Posts: 2

Participants: 2

Read full topic

Linux Installation Problem

$
0
0

@Dhiraj0116 wrote:

I have been configured the cocos2d-x on windows machine and worked on that but now moving to linux for the development of the cocos2d-x games.
I am not getting the proper help to install it and run on the android.
There are few extra question in my mind related to the installation.
1. Do I need to install java for this?(Linux has java preinstalled)
2. I know the python is also installed in it.
So Can any one tell me all the steps in detail to install and the cocos2d-x on linux and run it on Android.

Thanks in Advance

Posts: 2

Participants: 2

Read full topic

Obtain custom properties from tile layer in tmx file

$
0
0

@nichlaspro132 wrote:

Hi!

How can I get the custom properties of a tile so that when I iterate the whole tmx map I check every single tile and if it has a custom property named phys and the value for that is done then something more would happen to that specific tile?
Hope you understand my point.
Thanks!

Update: The reason is I cannot really find any c++ info about how to retrieve it from a tile layer but only from an object layer

Posts: 1

Participants: 1

Read full topic

Getting the width of a Label

Viewing all 2747 articles
Browse latest View live