@SteinOveHelset wrote:
Hi,
if you open a game with game center on a Chromebook you don’t get signed in to Google Play. Is there a way to know if you’re on a Chromebook / a device that does not support google play?
Posts: 1
Participants: 1
@SteinOveHelset wrote:
Hi,
if you open a game with game center on a Chromebook you don’t get signed in to Google Play. Is there a way to know if you’re on a Chromebook / a device that does not support google play?
Posts: 1
Participants: 1
@Arun55 wrote:
cocos creator version 2.0.8
I am using loadscene
cc.director.loadScene(‘GameScene’);
after game complete to load again game scene but some nodes are not destroyed
In browser can any one help me outvar m_bTouchStart = false;
var m_iAnsSpr = null;var GameManager = cc.Class({
extends: cc.Component,properties: { Gamespr: cc.SpriteFrame, Bgspr: cc.SpriteFrame, Heart:cc.SpriteFrame, }, // LIFE-CYCLE CALLBACKS: onLoad () { D.GameManager = this; var self = this;
}
start ()
{this.CreateGameSprite(); }, CreateGameSprite: function() { // x = this.node.getComponent("GameObject"); this.composeData(); },
}
That variables are not resetting what ever i declared outside
can anyone help me out
Posts: 1
Participants: 1
@NoahKange wrote:
Hello Everyone, I would like to know if anyone knows a way I can implement the “Prince of Persia sands of time” reverse time mechanic. I would like to implement in a way that when a player dies and meets the conditions to continue playing, they can be reversed to a previous check point, probably by reversing all the animations within the scene, has anyone found a clean way of pulling this off?, thanks in advance.
Posts: 2
Participants: 2
@mantoun wrote:
Hi,
I have the same problem reported in the following conversation but with c++
any help ?
Thank you in advance.
Posts: 1
Participants: 1
@oziphantom wrote:
Can I add a custom step to be run before the code is err “packaged”. Basically my level data is external and having to remember to save in excel, run custom build in cmd line, then run in creator is error prone. Having it run “build level data” bat file then package would make it so much nicer.
Posts: 2
Participants: 2
@Postelzhuk wrote:
I load prefab from
resources
folder usingcc.loader.loadRes()
function. Some prefabs have shared dependencies with active scene. So after releasing prefab resources I’m getting an error at runtime.
This is release code example:let dependencies = cc.loader.getDependsRecursively("prefab01"); //Need to exclude scene dependencies here //How to get active scene dependencies? cc.loader.release(dependencies);
How to get scene resource dependencies to exclude them from dependencies array?
Posts: 1
Participants: 1
@sayiciemre wrote:
I would like to drop swinging left and right yellow square above white rectangles as shown in images down below.But it’s not placed properly however if i comment out rotating action for swinging property, yellow square placing correctly as i want to be.
this.gameMode = this.IDLE;
this.square.setPosition(320, 860);
this.square.setAnchorPoint(0.5, 0.5);this.square.setRotation(0); this.leftSquare.setPosition(this.width / 2, 0); this.leftWall.setPosition(this.width / 2, this.leftSquare.height); this.rightSquare.setPosition(this.width/2, 0); this.rightSquare.setAnchorPoint(0, 0); this.rightWall.setPosition(this.width / 2, this.rightSquare.height); this.updateLevel(); var swingSquare = cc.rotateBy(0.4, 50); var swingBackSquare = cc.rotateBy(0.4, -50); var swingForever = cc.repeatForever(cc.sequence(swingSquare, swingBackSquare)); **//this.square.runAction(swingForever);** this.node.on('touchstart', function (event) { this.grow(); }, this); this.node.on('touchend', function (event) { this.stop(); }, this); }, grow: function() { if(this.gameMode == this.WAITING) { this.gameMode = this.GROWING; this.growScale = cc.scaleBy(this.growTime, 5.1, 5.1); this.square.runAction(this.growScale); } //this.fallAndBounce(); }, stop: function() { if(this.gameMode == this.GROWING) { this.gameMode = this.IDLE; var stopScale = this.square.stopAction(this.growScale); var stopSwingSquare = this.square.stopAllActions(); var fixSquare = cc.rotateTo(0.1, 0); this.square.runAction(fixSquare); var stopFallSequence = cc.sequence(stopScale,stopSwingSquare); this.fallAndBounce(); //this.square.runAction(stopFallSequence); //this.square.runAction(stopFallSequence); } }, fallAndBounce: function() { var squareRectangle = this.square.getBoundingBox(); var squareHeight = squareRectangle.height; var squareWidth = squareRectangle.width; var fixSquare = cc.rotateTo(0.1, 0); if(squareWidth <= this.holeWidth) { // çukurun en aşağısına düşme durumu var am = this.square.y - this.leftSquare.height - (squareHeight / 2); var fallTo = cc.moveBy(0.4, cc.v2(0, -this.square.y -this.square.height / 2)).easing(cc.easeQuadraticActionIn()); var seq = cc.sequence(fixSquare, cc.delayTime(0.3), fallTo); this.square.runAction(seq); } else { if (squareWidth <= this.wallWidth) { var am2 = this.leftSquare.height + squareHeight / 2; var fallTo2 = cc.moveTo(0.6, cc.v2(this.square.x , am2 )).easing(cc.easeBounceOut(0.6)); seq = cc.sequence(fixSquare, cc.delayTime(0.3), fallTo2); this.square.runAction(seq); } else { var am3 = this.leftWall.height + this.leftSquare.height + squareHeight/2; var fallTo3 = cc.moveTo(0.6, cc.v2(this.square.x, am3)).easing(cc.easeBounceOut(0.6)); seq = cc.sequence(fixSquare, cc.delayTime(0.3), fallTo3); this.square.runAction(seq); } } },
Posts: 1
Participants: 1
@blackcat99 wrote:
i’m newbie, i was looking for basic box2d and very few documents, i need help. box2d basic movement and collision checking.
Posts: 4
Participants: 4
@hananht wrote:
Hello again,
It seems like the tweens and the cc.Actions are not synced with the update method.
Does they have there own clock (Interval) ?What I am trying to do is to make nodes to move with a speed parameter.
Inside the update method, the node moves like this:this.node.y -= this._speed * dt;
When I am pressing a button I want to stop the movement of the node by setting its speed to 0 like so:
From position A to Position B (deltaDistance) set speed from its current state to 0.No mater what I am doing, It looks like it is not synced well with the update…
Posts: 1
Participants: 1
@smellypotato wrote:
cc.sys.language only returns “zh” no matter what my device’s language is, and cc.sys.languageCode is undefined. how can I get my device’s language properly?
Posts: 2
Participants: 2
@FailingUser wrote:
I have a something in my game that is supposed to be (566 x 70), in my graphic design application (Affinity Designer), I create a texture with the size of (566 x 70), however, after I create the sprite in cocos2d, it’s smaller than the size it’s supposed to be, printing the size revealed that it was (530 x 65) for some reason. I could manually set the content size, but I don’t know if that’s what I’m supposed to do.
When the sprite is scaled (how it’s supposed to look)
When the sprite is not scaled (how it’s not supposed to look)
If design resolution is the size with which you design assets, why does is the size of the sprite incorrect?
Posts: 1
Participants: 1
@hananht wrote:
Hello,
can someone add this class to the creator.d.ts?
export class vmath { static readonly EPSILON = 0.000001; static equals(a, b); static approx(a, b, maxDiff); static clamp(val, min, max); static clamp01(val); static lerp(from, to, ratio); static toRadian(a); static toDegree(a); static randomRange(min, max); static randomRangeInt(min, max); static nextPow2(val); static abs(v); static min(x, y); static max(x, y); static isPow2(v); static log2(v); static log10(v); static popCount(v); static countTrailingZeros(v); static nextPow2$1(v); static prevPow2(v); static parity(v); static reverse(v); static interleave2(x, y); static deinterleave2(v, n); static interleave3(x, y, z); static deinterleave3(v, n); }
Also, tween is incorrect. need to change constructor from:
constructor
to:
constructor(target?: any);
and change:
target(): void
to
target(obj: any): void;
Also, it would be very handy, if you update the render engine properties:
cc.renderer.renderEngine ...???
It can help by developing shaders more efficiently and understand them properly.
Cocos creator is a great engine! Keep up the good work!
Posts: 1
Participants: 1
@junhao_mm wrote:
tl;dr:
- What’s the recommended way of handling the unused (but not blacked out) space around the design resolution which is created on some devices when Creator fits the canvas into the available screen space?
- How can I achieve a completely native, dynamic resolution with Creator? I.e. a canvas which changes its size in pixels exactly according to the available screen space without any additional scaling which would make the game blurry.
I want to learn how the sizing and scaling of Canvas works in practice.
The first issue comes from the mismatch between the docs and how Creator works now:
The docs describe scaling and resizing always with a black border which will appear, but according to this forum post that’s not the case any more, which is also the behavior that I observed, for example in the iPhone 5 simulator in the browser: (I changed the camera’s background color to white so it’s more obvious what I’m talking about)
Note that my design resolution is in portrait and the screenshot is in landscape mode, and I’m using Fit Height but that’s only to illustrate my point. Normally the “black-border” space will be a lot smaller, but still there.
Magenta: design resolution 640x960
Orange: frame size 568x320
Black: viewport rect 1136x640
Red: canvas size 1136x640 (in the picture the viewport and canvas have the same size, so it’s difficult to see and looks like a brown rect, but in fact it’s black and red)
Cyan: canvas size scaled with scaling factors from view (cc.view.getScaleX() and Y), or win size 1704x960
Scale: 0.66…/0.66…
I can use, see, click, draw into, etc any of the screen space around the magenta rectangle, which represents my design resolution. Is it a valid workaround to draw two black rectangles outside of the design resolution space, so that 1) no artifacts from undesigned screen space are visible to the user and 2) no user has advantages over other users because they can see more of the game screen?
Or what’s the recommended way?The second topic is similar. If I were to make a traditional game for desktop with Creator, my approach would be the following: make the canvas as large as possible to fill the whole browser window, and maybe even ask the user to make the browser window completely full-screen to remove any UI from the OS. Then I’d turn off Fit Height as well as Fit Width so Creator doesn’t resize anything. As I understand it, in this case instead of making the drawable canvas bigger as a whole, Creator would still use the scaling factor to fill the whole screen instead of simply resizing the canvas to fit the native resolution. Even if I turn all fitting options off. Simple example: I make a design resolution of 960x640 and turn both fitting options off. Start the browser and the following sizes and scales are given to me:
1920/1280 (canvas size)
960/640 (frame size)
1920/1280 (viewport rect)
2/2 (scale)
I would have expected the frame size to fit the canvas size and the scale to be 1/1. So how can I resize the canvas myself programatically to achieve native scaling for desktop environments?
Posts: 1
Participants: 1
@ancomchancanh wrote:
Hi all Cocos Creator users!
I’ve just upgraded from 1.9.3 to 2.0.9 and found out many changes with camera.As mentioned here: https://docs.cocos2d-x.org/creator/manual/en/render/camera.html
Multi-camera support allows you to easily implement advanced customization effects, such as the two-player split screen effect, or the creation of a small scene map
So I wonder how to implement the split screen or a small map using camera?
I’ve searched the docs as well as forum with no luck.As I know the camera will flush all it captures directly to entire viewport screen. How do we restrict the render area of a camera, so, smthing like output of camera 1 renders only to left half and camera 2 to right half of screen?
Thanks in advance for any suggestion!
And many thanks to @slackmoehrle if you could help.
Posts: 2
Participants: 2
@bolin wrote:
Hi, I’m updating to the latest cocos2d-x version in the git repo and when trying to build the cocos binaries for android I get the following error:
cocos gen-libs -c -p android --app-abi armeabi-v7a:arm64-v8a
Checked the changelog and found:
[REFINE] cocos console: disable “gen-libs” command
Couldn’t find any info why this was done
We build the cocos binaries to speed up android compilation.
Posts: 3
Participants: 3
@blackcat99 wrote:
- How to prevent objects from sinking when dropped : 0:02 in video.(i use jumby to jump)
-I do not want this : 0:00 -> 0:01 and 0:09 -> 0:11 in video.What should I do
(To move, I use setvelocity)
Posts: 1
Participants: 1
@ancomchancanh wrote:
Hi Creator users
My situation is like this: my character needs to move over a (polygon) area which will cause him damage every frame. The amount of damage depends on how large the overlap section the character shares with polygon area. I’m going to achieve this by using physicPolygonCollider & physicBoxCollider.
So I wonder if I can calculate area of overlapped section when a node (A) with physicPolygonCollider (sensor=true) moves and overlap a node (B) with physicBoxCollider (sensor=false) ?
Please anyone let me know if I can do this and how to?
Thanks for all suggestions !
Posts: 1
Participants: 1
@biunsan wrote:
Hello, I’m happy to announce my game R Mahjong - real riichi (japanese) mahjong game.
Some key features:
- The rules basically correspond to the standard Japanese ones (with open tanyao, red fives, atozuke ari, double ron).
- Real and fast artificial intelligence.
- Support for multiple interface languages (English and Japanese).
- Player progress is displayed (rating).
Open Beta version available on Google Play:
https://play.google.com/apps/testing/com.arttech.rmahjong
I would be very grateful if you test R Mahjong and give feedback, especially if you know how to play
.
R Mahjong is made using cocos2d-x v3.17, Boost.Asio, SQLite.
Since the application initially has a network architecture, in the future it is planned to implement the game on the local network (via wi-fi).
And then the game in the global network. But so far only the local game against AI has been implemented.Gameplay Video:
support site: http://riichimahjong.net
Posts: 3
Participants: 2
@pacear10 wrote:
Hello everyone wanted to know what is the way to change the sprite of a prefab to click, I have seen some topics in the forum but nothing concrete and other unanswered, is for a game on android
Posts: 1
Participants: 1
@adikhel wrote:
Cocos Creator was not responding, so had to ctrl+alt+delete.
Now, all my scenes are blank. All nodes gone. Is there any way to save the project? It had a month’s work at least.
I get this now instead.
TypeError: Cannot read property ‘_onBatchCreated’ of null
at cc_Node._onBatchCreated (C:\CocosCreator\resources\engine\bin.cache\dev\cocos2d\core\CCNode.js:761:32)
at cc_Node._onBatchCreated (C:\CocosCreator\resources\engine\bin.cache\dev\cocos2d\core\CCNode.js:761:33)
at cc_Node._onBatchCreated (C:\CocosCreator\resources\engine\bin.cache\dev\cocos2d\core\CCNode.js:761:33)
at cc_Node._onBatchCreated (C:\CocosCreator\resources\engine\bin.cache\dev\cocos2d\core\CCNode.js:761:33)
at cc_Scene._onBatchCreated (C:\CocosCreator\resources\engine\bin.cache\dev\cocos2d\core\CCNode.js:761:33)
at cc_Scene._load (C:\CocosCreator\resources\engine\bin.cache\dev\cocos2d\core\CCScene.js:60:30)
at cc.Director.runSceneImmediate (C:\CocosCreator\resources\engine\bin.cache\dev\cocos2d\core\CCDirector.js:179:23)
at C:\CocosCreator\resources\engine\bin.cache\dev\cocos2d\core\CCDirector.js:327:42
at CCLoader. (C:\CocosCreator\resources\engine\bin.cache\dev\cocos2d\core\platform\CCAssetLibrary.js:63:25)
at C:\CocosCreator\resources\engine\bin.cache\dev\cocos2d\core\load-pipeline\CCLoader.js:139:46
Posts: 1
Participants: 1