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

How to prevent click location trigger when offscreen?

$
0
0

@Meir_yanovich wrote:

I have web cocos2d-x js test , i set it to be in the index.html :

<canvas id="gameCanvas" width="800" height="450"></canvas>

Then in main.js i set it to be :

cc.view.setDesignResolutionSize(960, 640, cc.ResolutionPolicy.SHOW_ALL);

but when i click out side the game canvas the sprite moving off screen , how can i prevent it without doing manual screen calculation or this is the only why ?

here is a picture :

Posts: 5

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 17076

Trending Articles



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