This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setupResolutionPolicy(float designW, float designH) | |
{ | |
GLView *view = Director::getInstance()->getOpenGLView(); | |
Size screenSize = view->getFrameSize(); | |
float designRatio = designW / designH; | |
float screenRatio = screenSize.height / screenSize.width; | |
ResolutionPolicy resolutionPolicy = screenRatio < designRatio ? | |
ResolutionPolicy::FIXED_HEIGHT : ResolutionPolicy::FIXED_WIDTH; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script to generate the src file and include used by jni/Android.mk | |
# | |
# Please define the Main source directory | |
# --------------------------------------- | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
SRC_DIR=$DIR/../Classes | |
OUT_FILE=$DIR/jni/Sources.mk | |
EXCLUDE_DIR="Win32|UnitTest\+\+\/tests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_CPPFLAGS := -DENABLE_TDD | |
LOCAL_MODULE := cocos2dcpp_shared | |
LOCAL_MODULE_FILENAME := libcocos2dcpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MyLayerColor.h | |
// | |
#include "cocos2d.h" | |
USING_NS_CC; | |
class MyLayerColor : public cocos2d::LayerColor | |
{ | |
public: | |
static MyLayerColor *create(const Color4B& color, float width, float height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String generateToken(String prefix, int uid) | |
{ | |
long now = System.currentTimeMillis(); | |
// Shorten integer values | |
String nowStr = Base64.encodeLong(now); | |
String uidStr = Base64.encodeInt(uid); | |
// Concatenate | |
String token = prefix + nowStr + uidStr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TIME_FILE=/etc/temp/datetime.txt | |
USER=admin | |
REMOTE_SERVER=192.168.0.1 | |
REMOTE_PORT=22 | |
REMOTE_PATH=/home/admin/temp | |
# Make a file and then send to Lab server | |
date > $TIME_FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "AppHelper.h" | |
#include "cocos2d.h" | |
bool AppHelper::isDebugMode() | |
{ | |
#if COCOS2D_DEBUG > 0 | |
return true; | |
#else | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AdHelper.cpp | |
// TapToJump | |
// | |
// Created by Ken Lee on 25/8/15. | |
// | |
// | |
#include "AdHelper.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.cocos2dx.cpp; | |
import android.app.Activity; | |
import android.graphics.Color; | |
import android.view.View; | |
import android.view.ViewGroup.LayoutParams; | |
import android.widget.LinearLayout; | |
import com.google.android.gms.ads.AdRequest; | |
import com.google.android.gms.ads.AdSize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void RenderTexTest::testUsingCocos(Ref *sender) | |
{ | |
Node *rootNode = CSLoader::createNode("GameOverDialog.csb"); | |
rootNode->setScaleY(-1); | |
rootNode->setAnchorPoint(Vec2(0, 1.f)); | |
RenderTexture *texture = RenderTexture::create(320, 400, Texture2D::PixelFormat::RGB888); | |
OlderNewer