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

How does cocos2d-x compile command set SDKVersion for Android Studio project?

$
0
0

@sinhviencodon wrote:

So I want to compile my cocos2d-x project for Android Studio using cmd with:

cocos compile -p android --android-studio --ap android-22

I found the description about --ap option in the wiki : Specify the API-Level of android sdk. Console will auto select it if not specified. .

My question is that:
1/ Is this API compiledSDKVersion or minSDKVersion or targetSDKVersion? And how do I set those SDKVersion in above command?
2/If I want to change those SDKVersion , could I just edit build.Gradle(Module:MyApp) and build.Gradle(Module:libcocos2dx) then Sync Gradle or I have to recompile using the cmd with above command?
Your attention is very much appreciated.

Posts: 1

Participants: 1

Read full topic


Can't compile for Android under Windows 10

$
0
0

@Gdrop wrote:

Using CocosCreator I built project succesfully, but can't Compile. Here is log file:

    Building mode: release
    Using Android Studio project : E:\CocosProjects\ExampleCollection1\build\jsb-default\frameworks\runtime-src\proj.android-studio
    running: '"C:\Android\SDK\tools\android" update project -t android-23 -p E:\CocosProjects\ExampleCollection1\build\jsb-default\frameworks\runtime-src\proj.android-studio\app'

    **************************************************************************
    The "android" command is deprecated.
    For manual SDK, AVD, and project management, please use Android Studio.
    For command-line tools, use tools\bin\sdkmanager.bat
    and tools\bin\avdmanager.bat
    **************************************************************************

    Invalid or unsupported command "update project -t android-23 -p E:\CocosProjects\ExampleCollection1\build\jsb-default\frameworks\runtime-src\proj.android-studio\app"

    Supported commands are:
    android list target
    android list avd
    android list device
    android create avd
    android move avd
    android delete avd
    android list sdk
    android update sdk
    Error running command, return code: 1.

Posts: 1

Participants: 1

Read full topic

Quarter screen on android

$
0
0

@skalexey2 wrote:

Hi everyone.
I use cocos2d-js-v3.6.1.
I have created a clean project through cocos new. When I run a project through cocos run -p android and the screen of my device is off and locked and then I unlock the screen, I see the such problem:

The app is running on quarter of the screen and buttons are not responding.
I am sure - this is a known problem and there is a solution, but don't know the exact reason of this and where to start to dig. So does anyone know how to fix it ?

Posts: 1

Participants: 1

Read full topic

Need Help starting with 3D game

$
0
0

@Shobhit wrote:

I have developed 2d games in cocos2dx but wanted to start with 3D games but can't find any useful resource or example, even the Fantasy Warrior is in lua and not in c++. I looked into the test examples but they also look scattered and also very slow like in Scene 3D example, character could hardly move on. Moving terrain in Terrain example is also not smooth.
I could't even make a decision about if I should continue with this engine for 3D games.
Please explain if this engine is ready for 3d game development and if yes suggest resources to start with.

Posts: 3

Participants: 3

Read full topic

China markets like Steam

$
0
0

@cjsbox wrote:

Hi everybody!

Are there markets like Steam in China? And has anybody published games to China markets?

Please share your experience.

Looking forward to hear about it:)

Posts: 1

Participants: 1

Read full topic

We should unify all cocos2d-x products in one product/app

$
0
0

@unrealsense wrote:

Hello guys,

First of all I am not 100% sure this is the best category for this post but because I think it can be seen as a feature request I decided to add it here.

I am new to cocos2d-x altough I have experience with other game engines/frameworks. I consider myself an enthusiast of game engines and software that happens to also be a game developer. So in my free time I like to tinker arround with the options out there.

I've been using unity since 3.5 , I have made a PC game on UDK with a team of 5 and played around with UE4. I have also played arround with lua frameworks like Corona and Gideros.

As a new commer to cocos2d-x I like what I see , I like the open source idea behind it , but the first time starting with cocos2d-x can be very, very confusing.

Let me explain. As you go to the products page of cocos2d-x there are 4 different products to download. There is cocos2d-x the framework , then there is the Cocos Creator with Cocos2d-Javascript (I think will support c++ in future), then Cocos and finally SDK Box for 3rd party software and plugins.

So while with others like Unity or UE4 there is only one download option here we have 4 which can confuse new users.

I started trying Cocos. So far it looked promissing , it downloads cocos2d-x for you and it even helps you download other stuff like the Android SDK or plugins from SDKBOX.
As a GUI to create projects seemed super decent as well giving me different options on how I want my project and even integrating plugins for me. Kudos on that. But then it also includes Coco Studio which is deprecated and the version of cocos2d-x is 3.10 instead of the latest 3.14. So I would be working on an outdated cocos2d-x.

Then we have the editors, there is Coco Studio which was working more or less with cocos2d-x but has been discontinued. We have also Cocos Creator that it feels way more mature than Cocos Studio with better integration with coding or scripting in this case but only for javascript. Besides that there is no real editor option for cpp.

With all this what I want to say is that there are a lot of options so many that its very confusing.

What its my proposal?

Lets do a suite that allows us to download only one app and from there download whatever its necessary in a modular way.

Lets do a cocos2d-x that its modular.

I think something very close to what Cocos already is but we could improve some options.

What if we make installing cocos2d-x somewhat very similar as it is for Unity. With Unity you download only one app then there you select in a list things you want to install and add (which require extra downloads handled by the same app). Things like platforms (iOS, Android, Windows Phone , Linux, etc..) and then Example Projects , Standard Assets, etc.

So here are some ideas.

We can do a main app called CocosSuite or whatever. Once you download this app and you install it then you can manage what things you want to download.

  • It should allow you to download and update the latest version of cocos2d-x available.

  • Downloading Cocos Creator or the editor for the scenes and UI should be an option appart (some people might not want to use the editor and just need the base cocos2d-x).

  • When you create a project the way cocos works I think its pretty good where you can select language and plugins . The only thing I would maybe add here is if the project will be meant to be used with editor or raw. Because projects seem to be a bit different from cocos2d-x and cocos editor. Maybe there is another way to solve this but I think this for now would be a good workaround.

  • Would be cool to add in the list to download examples in case someone wants to check the already pretty extense example projects and having always ther the option to navigate through different examples.

  • We could even add some UI options to do what cocos command line tool does but from UI like the build , run and deploy but made from a Graphical User Interface. Something like select your project and then another pop up appears with different options like platfrom , debug/release and actions (build,rung,...)

  • SDKBOX download option in case someone wants to adapt some of the plugins they are using altough I think making it seamles with the creation of the project and have it just ready to go is the best option for beginners.

I think cocos2d-x its doing some things right but there seems to be also a tendency to stop development on certain tools and leaving them half-finished like with Cocos Studio or with Cocos having only v3.10. If we could focus having a one soluton that integrates with all the products I am sure more people would have an easier time adopting this great framework.

So to make it short , unify everything in only one app and make it modular so the user can choose what he wants to use and what not with the possibility of adding it later. Also this should help keeping always the latest update or version of Cocos Editor and cocos2d-x.

Sorry for the long post and please let me know what you guys think about what I posted maybe other more experiences user have another point of view or can add some stuff they wished was there for them when they started.

Cheers and happy coding!

Posts: 2

Participants: 2

Read full topic

Getting sprite position on world inside shader

$
0
0

@Kotaiba wrote:

Hi,
any way i can get sprite position on world without passing it using Uniform ,i wanna use one shader on multiple sprites and i want to get each sprite position in world ,I have moving camera and the shader is not moving with the camera .

 float distance = sqrt(pow(gl_FragCoord.x - lightPosition[i].x, 2.0) + pow(gl_FragCoord.y - lightPosition[i].y, > 2.0));

using gl_FragCoord will not move with the camera .lightPosition is the position of the light, any way i can do that ?

Posts: 5

Participants: 2

Read full topic

Cocos2d-js game not porting for native apps

$
0
0

@himanshu_saini wrote:

I made a game in cocos2d-js using 3rd party SDK(appwarp).Now the cocos2d-js code is porting successfully for native apps but appwarp code is not working.
please help me

Posts: 1

Participants: 1

Read full topic


Google admob SMART_BANNER position

$
0
0

@KimDK wrote:

Hi

I attached admob as BANNER, but it is to small in tablet so i changed it's size to SMART_BANNER.

but banner's position is not in bottom, but little above from bottom.

this is my android-studio banner create code.

            mAdView = new AdView(_appActivity);
            mAdView.setAdSize(AdSize.SMART_BANNER);
            mAdView.setAdUnitId(_appActivity.getResources().getString(R.string.ad_banner));

            mAdView.loadAd(adRequest);
            /*
            LinearLayout linearLayout = new LinearLayout( _appActivity );

            LinearLayout.LayoutParams adParams = new LinearLayout.LayoutParams(
                    LinearLayout.LayoutParams.MATCH_PARENT,
                    LinearLayout.LayoutParams.WRAP_CONTENT);
            adParams.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;
            linearLayout.addView( mAdView, adParams );
            _appActivity.mFrameLayout.addView( linearLayout );
            */
            RelativeLayout relativeLayout = new RelativeLayout(_appActivity);
            relativeLayout.setY(0);
            _appActivity.mFrameLayout.addView(relativeLayout);


            RelativeLayout.LayoutParams adViewParams = new RelativeLayout.LayoutParams(
                    AdView.LayoutParams.WRAP_CONTENT,
                    AdView.LayoutParams.WRAP_CONTENT);
            // align bottom
            adViewParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
            // align center
            adViewParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);


            relativeLayout.addView(mAdView, adViewParams);

            mAdView.setBackgroundColor(Color.BLACK);

            mAdView.setBackgroundColor(0);

How do i change the code? thanks.

Posts: 1

Participants: 1

Read full topic

VS2015 always rebuilds all project in 3.15

$
0
0

@madlexus wrote:

Hi!
Any time I'm starting to build a win32 solution - msbuild makes from start, even when it already compiled!
It's appears on 3.15 with msvs2015

Posts: 1

Participants: 1

Read full topic

Cocos2dx + Box2d: Position of object in different screen resolution and aspect ratio

$
0
0

@tomsawyer wrote:

I'm writing a pool game, so i need the same aspect ratio for every devices. In the play scene, i spend an area for playground on the top (physics happens in this area). The bottom area is for displaying HUD.

The result is for each device aspect ratio, i'll have different object coordinates.

How can i solve this with box2d? Like applying physics to the specific node with specific size? I see the b2World can only apply for whole layer?

Or i have to translate object coordinates on each devices?

Posts: 1

Participants: 1

Read full topic

Crashes game on iOS device/simulator

$
0
0

@watermelonlab wrote:

I had a old project which was working fine on os x yosemite and xcode 7.3 but when i update my os to Sierra and latest xcode then project is building and signing after launching on device or simulator it is crashing on sprite object which is null but resource is already in project and same thing is working before update. Help me to resolve this if anybody face this issue help me to resolve.
Thanks

Posts: 1

Participants: 1

Read full topic

Is proj.android folder useless?

$
0
0

@drakon99 wrote:

Hi guys! :slight_smile:

Let me do a dumb question:

Is the folder proj.android useless?
With cocos 3.15 we can fully work with android studio right?

I'm using sdkbox also: does sdkbox command require proj.android to work properly?

Thanks for your help!

Posts: 3

Participants: 2

Read full topic

Cocostudio problem in 3.15

$
0
0

@arkrian wrote:

I upgraded my game from version 3.141 to version 3.15 and found some bugs.

1) In previous versions, applying opacity or fade-action to a node created with Cocostudio in code has been applied to all children. However, in 3.15, it seems that Opacity or Fade may not apply to Children.
2) Alignment of Text created in Cocostudio is not applied. Also, custom-size does not apply. In my game, the text alignment setting is to the left, but it is centered (the alignment value is displayed correctly in the debugger).
3) Animation may stop without reason. So EndCallback does not run and stops.

As a result, Cocostudio Runtime seems to have problems in 3.15.
I want to be fix as soon as possible.

Posts: 1

Participants: 1

Read full topic

Any tips on designing a layout?

$
0
0

@anggaaryas wrote:

Hi, may i ask about layout?
1 . what size should i use to create button sprite, character sprite, etc? i am confuse to determine the size before the game will be scaled to other screen resolution.
2. Any tips to easy to know the cordinat to place my sprite? I want to put near " x sprite " but do not know the distance
3. Is there any layout preview for cocos2d-x?
4. Any tips guys? :slight_smile:
Thank you :smiley:

Posts: 1

Participants: 1

Read full topic


Cocos2d-x 3.15 Android Studio and Visual Studio 2017 problems

$
0
0

@mik4s wrote:

Hello, I am facing two problems.

1st: Android Studio 2.3.1
Looks like cocos2d directory is not linked properly. But I don't know how to fix it.

2nd: Visual studio 2017
When I open proj.win10 I get these errors.

C:\Users\Mykolas\Documents\Cocos2d-x\JoeRider\cocos2d\external\Box2D\proj-win10\libbox2d.vcxproj : error : Unable to read the project file "libbox2d.vcxproj".
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1975,3): The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.Cpp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

C:\Users\Mykolas\Documents\Cocos2d-x\JoeRider\cocos2d\cocos\editor-support\spine\proj.win10\libSpine.vcxproj : error : Unable to read the project file "libSpine.vcxproj".
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1975,3): The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.Cpp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

C:\Users\Mykolas\Documents\Cocos2d-x\JoeRider\cocos2d\cocos\2d\libcocos2d_win10\libcocos2d.vcxproj : error : Unable to read the project file "libcocos2d.vcxproj".
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1975,3): The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.Cpp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

C:\Users\Mykolas\Documents\Cocos2d-x\JoeRider\proj.win10\App\JoeRider.vcxproj : error : Unable to read the project file "JoeRider.vcxproj".
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1975,3): The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.Cpp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

C:\Users\Mykolas\Documents\Cocos2d-x\JoeRider\cocos2d\external\bullet\proj.win10\libbullet.vcxproj : error : Unable to read the project file "libbullet.vcxproj".
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1975,3): The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.Cpp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

C:\Users\Mykolas\Documents\Cocos2d-x\JoeRider\cocos2d\external\recast\proj.win10\librecast.vcxproj : error : Unable to read the project file "librecast.vcxproj".
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1975,3): The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.Cpp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Any ideas?

Posts: 1

Participants: 1

Read full topic

[Error] unable to get stub builder json Android Studio

$
0
0

@adesuluh wrote:

im using ndk r13b, when i compile there is an error in JSON schema like

EmptyThrowable : unable to get stub builder for com.jetbrains.jsonSchema.JsonSchemaFileType@7947a59e, path = ..

and i dont have any idea to fixed it :frowning: anyone can help ?

Posts: 1

Participants: 1

Read full topic

3d position audio engine support plan?

$
0
0

@lawheihachi wrote:

We are developing a 3D game.
Use version 3.14
However, the audio engine only supports 2d.
Are you planning to support 3d audio engines in the future?

Posts: 1

Participants: 1

Read full topic

Visual UI Editing Options for Cocos2d-x version 2.2.6

$
0
0

@wosullivan wrote:

Hello,

I recently inherited a large project that is still using cocos version 2.2.6. We have plans to overhaul the frontend/UI and I was considering the options I can use to achieve this.

The current process uses a custom build tool which exports illustrator files to json, which is then used to instantiate sprites and buttons in c++. While this process works, it is a bit cumbersome and time consuming and for the most part the position information becomes redundant when objects get parented etc. It also doesn't cater for any kind of animation.

I have seen mention the use of a few different UI tools and would like to know about the feasibility of their use.

Firstly there is Cocos Studio which I believe is now unsupported but may be ok in my case as I'm still on 2.2.6.

Secondly there is Cocos Builder which seems to be in a similar state to Cocos Studio.

Thirdly there is Cocos Creator, which doesn't seem to fully support c++ currently.

For each of these options, is it possible to retro fit their functionality into an existing Cocos project, or do the projects have to be created from scratch in the respective builders?

Is updating Cocos to 3.* an inevitability if I want to use one of these options?

The project is on both android and iOS.

Thanks a million for taking the time to read!

Posts: 2

Participants: 2

Read full topic

Advice on versions (minSdkVersion/targetSdkVersion...)

$
0
0

@katieJ wrote:

Hi,

I'm moving a project to android and wanted some advice on what values I should be using for:

minSdkVersion
targetSdkVersion
compileSdkVersion
buildToolsVersion

Android studio has just updated buildtools to 25.0.5 so I guess I'm good to go with that? Is minSdkVersion the lowest android version the app will run on? what about targetSdkVersion? is that the ideal version??? and then compileSdkVersion what is that? Is that the version I want to be compling with??

Thanks,
Katie

Posts: 3

Participants: 3

Read full topic

Viewing all 2748 articles
Browse latest View live