Skip to content

Instantly share code, notes, and snippets.

@Seasons7
Seasons7 / myApp.js
Created March 8, 2014 18:41
object life cycle cocos2d-x jsb
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2008-2010 Ricardo Quesada
Copyright (c) 2011 Zynga Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@Seasons7
Seasons7 / hello.js
Created December 29, 2013 17:59
touchevent_coocs2djsb
require("jsb.js");
try {
director = cc.Director.getInstance();
winSize = director.getWinSize();
centerPos = cc.p(winSize.width / 2, winSize.height / 2);
var IconSprite = cc.Sprite.extend({
@Seasons7
Seasons7 / adb_screenshot
Created October 24, 2013 06:03
android device screenshot
adb shell screencap -p /sdcard/screen$1.png
adb pull /sdcard/screen$1.png
adb shell rm /sdcard/screen$1.png
@Seasons7
Seasons7 / hello.js
Created September 22, 2013 02:02
call this._super() sample
require("jsb.js");
try {
director = cc.Director.getInstance();
winSize = director.getWinSize();
centerPos = cc.p( winSize.width/2, winSize.height/2 );
var Person = cc.Node.extend({
@Seasons7
Seasons7 / hello.js
Created August 24, 2013 16:48
JSBSample01 simple hello.js
require("jsb.js");
try {
director = cc.Director.getInstance();
winSize = director.getWinSize();
centerPos = cc.p( winSize.width/2, winSize.height/2 );
var GameLayer = cc.Layer.extend({
@Seasons7
Seasons7 / addResource.py
Created March 16, 2013 17:42
add resources in xcodeproj
def add_resources(proj):
test01 = proj.get_or_create_group("test01")
resources = proj.get_or_create_group("Resources", parent=test01)
# res = proj.get_or_create_group("res", parent=resources)
proj.add_folder("test01/Resources/res", parent=resources)
@Seasons7
Seasons7 / addFile.py
Created March 16, 2013 17:05
add file in subgroup
from mod_pbxproj import XcodeProject
if __name__ == '__main__':
proj = XcodeProject.Load('test01.xcodeproj/project.pbxproj')
test01 = proj.get_or_create_group("test01")
resources = proj.get_or_create_group("Resources", parent=test01)
proj.add_file("hoge/a.txt", parent=resources)
proj.backup()
proj.save()
@Seasons7
Seasons7 / Monokai.theme.patch
Created December 14, 2012 17:24
SublimeText2 Block Cursor Color
<dict>
<key>name</key>
<string>Block Cursor</string>
<key>scope</key>
<string>block_cursor</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#FFFFFF</string>
<key>background</key>
@Seasons7
Seasons7 / seasons.js
Created November 19, 2012 23:37
dynamic new js object
var Seasons = function(){
this.name = "keisuke hata";
}
Seasons.prototype.sayHello = function() {
print("こんにちは!!");
}
@Seasons7
Seasons7 / CardFlip.js
Created November 8, 2012 20:52
CardFlip for cocos2d jsb
//------------------------------------------------------------------
//
// JavaScript sample
//
//------------------------------------------------------------------
//
// For a more complete sample, see "JS Watermelon With Me" bundled with cocos2d-iphone
//