Beauty Salon α-BET (alphabet)

space001
Blender3d Collada dae modeling Use Papervision3d on Progression3 and 4 http://a-bet.secret.jp/#/access
more whaison works.
whaison space
space002
http://whaison.jugem.jp/ https://jp.pinterest.com/whaison/ https://www.instagram.com/whaison/ https://whaison.amebaownd.com/
https://suzuri.jp/whaison
http://whaison.blogspot.com/
http://whaison.tumblr.com/ http://qiita.com/users/whaison http://www.behance.net/whaison https://github.com/whaison/ https://bitbucket.org/whaison http://serato.com/user/whaison http://whaison.hatenablog.jp/

typo memo
http://d.hatena.ne.jp/whaison/


dayNote
http://www.myspace.com/whaison http://ameblo.jp/whaison/ http://blog.crooz.jp/whaison/ http://blog.crooz.jp/whaisoncafe/ http://nenpyo.org/whaison

fulldisk
http://full.shin-gen.jp/
http://whaison.client.jp/
http://www.dclog.jp/whaison/
featured forums.
space004
forum.unity3d.com/

forums.unrealengine.com.

Progression Forum.

FlashDevelop Forum.

Papervision3D Forum.

FlexUserGroup Forum.

SparkProjectForum.





Twitter







Mobile
qrcode
Calendar
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930
31      
<< March 2024 >>
New Entries
Archives
Categories
Recent comment
  • FlashDevelopでフォント埋め込み
    感謝!! (12/24)
  • cocos2d-x-3.0rc0 ,c++ ,cpp でTexturePacker で 吐き出した、plist と png でパラパラアニメーションのコード例
    whaison (04/17)
  • Blender2.67にbvh(web上に2500個以上ころがってる)入れてそのBoneオブジェクトをUnity4.0のmecanimで使う
    whaison (08/19)
  • Apple Dev Center 「Certificates, Identifiers & Profiles」で Adhoc をつくってXCode4.6.1でArchiveしてipaを書き出し
    whaison (04/30)
  • Flash CS6でプロパティーパネルで物理演算のジャンプの高さを設定できるCitrus Engine
    whaison (03/01)
  • 「Flash以外、例えばKinectとか」ON TOKYO (会場:高田馬場4-11-8 Floor 6階 ) 短縮URL http://bit.ly/dI0Bfx
    uka (03/02)
  • App Store Review Guidelines アップル社のアプリ審査基準ガイドライン和訳 Apple が 開発者を悩ませ ユーザーをハッピーにしたいガイドライン。w
    whaison (01/25)
  • Unity3d では ADOBE JAPAN OSAKIで行われたFITC 2010 TOKYOでは、 「iOS用にパブリッシュするためには、フリー版ではなくて、有料版を買ってください。さらに追加のパッケージである、"iOS Package (for Development)"を買ってください」とのことだった。
    whaison (01/25)
  • enjoy Adidas-Futsal-Park
    whaison (01/16)
  • MacBookAir にFlashPlayer入れたらなった。Mac Flash Player 10.1/10.2でUstream などでカメラが認識されないバグそんなときはUstreamProducer!でもなくiPhoneだと直ぐにライブ配信できた
    whaison (01/14)
simple sintax high lighter2.0
space003
SyntaxHighlighter2.0用 の貼り付けコード作成する!
ブログパーツ-BLOG PARTS.
Profile
Links
Recommend
Sponsored Links
Admin
無料ブログ作成サービス JUGEM
Seach this site
            
2022.03.28 Monday
スポンサーサイト

一定期間更新がないため広告を表示しています

| スポンサードリンク | - | | - | - | pookmark |
            
2014.05.20 Tuesday
cocos2d-x-3.0rc0 ,c++ ,cpp でcocosbuilderのccbiアニメーションファイルをロードする。
cocos2d-x-3.0rc0 ,c++ ,cpp でcocosbuilderのccbiアニメーションファイルをロードするよ。

#include "HelloWorldScene.h"
#include "cocos-ext.h"
#include "cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h"
#include "cocos/editor-support/cocosbuilder/CCBReader.h"
#include "cocos/editor-support/cocosbuilder/CCNodeLoader.h"
#include "cocos/editor-support/cocosbuilder/CCLayerLoader.h"
#include "cocos/editor-support/cocosbuilder/CCSpriteLoader.h"
#include "PrologueSceneLoader.h"

using namespace cocosbuilder;
using namespace cocos2d::extension;
USING_NS_CC;

Scene* HelloWorld::createScene()
{
    // 'scene' is an autorelease object
    auto scene = Scene::create();
    
    // 'layer' is an autorelease object
    auto layer = HelloWorld::create();

    // add layer as a child to scene
    scene->addChild(layer);

    // return the scene
    return scene;
}

// on "init" you need to initialize your instance
bool HelloWorld::init()
{
    //////////////////////////////
    // 1. super init first
    if ( !Layer::init() )
    {
        return false;
    }
    
    Size visibleSize = Director::getInstance()->getVisibleSize();
    Point origin = Director::getInstance()->getVisibleOrigin();

    /////////////////////////////
    // 3. add your codes below...

    // add a label shows "Hello World"
    // create and initialize a label
    
    auto label = LabelTTF::create("Hello World", "Arial", 24);
    
    // position the label on the center of the screen
    label->setPosition(Point(origin.x + visibleSize.width/2,
                            origin.y + visibleSize.height - label->getContentSize().height));

    // add the label as a child to this layer
    this->addChild(label, 1);

    // add "HelloWorld" splash screen"
    auto sprite = Sprite::create("HelloWorld.png");

    // position the sprite on the center of the screen
    sprite->setPosition(Point(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));

    // add the sprite as a child to this layer
    this->addChild(sprite, 0);
    
    
    //////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////
    
    // CocosBuilderのファイルを読み込みゲーム画面を生成する
    cocosbuilder::NodeLoaderLibrary* nodeLoaderLibrary = cocosbuilder::NodeLoaderLibrary::newDefaultNodeLoaderLibrary();
    
    nodeLoaderLibrary->registerNodeLoader("CCNode", cocosbuilder::NodeLoader::loader());
        
    CCBReader* ccbReader = new cocosbuilder::CCBReader(NodeLoaderLibrary::getInstance());
    //http://gin0606.hatenablog.com/entry/2013/12/27/163357
    //setCCBRootPathでリソースをダウンロード&保存したパスを指定すると、
    //ccbiの中で使ってる画像などのファイルは、そこから探してくれるらしい。
    ccbReader->setCCBRootPath("/Users/noboruotsuka/Desktop/cocosproject/rc0/study003/study003/Resources/");
    Node* node = ccbReader->readNodeGraphFromFile("mytown_high_space.ccbi");
    
//    node->setPosition( Point(500, 300) );
    this->addChild(node);
    

     //////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////
    
    return true;
}


void HelloWorld::menuCloseCallback(Ref* pSender)
{
    Director::getInstance()->end();

#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
    exit(0);
#endif
}



でいいみたい。
| whaison | cocos2d-x | 21:00 | comments(0) | - | pookmark |
            
2014.04.16 Wednesday
cocos2d-x-3.0rc0 ,c++ ,cpp でTexturePacker で 吐き出した、plist と png でパラパラアニメーションのコード例
メモ:Cocos2d-x ,c++ ,cpp
TexturePacker で 吐き出した、plist と png でパラパラアニメーションのコード例

http://nyakagawan.hatenablog.com/entry/2014/03/22/112513
さん
を参考にさせてもらったよ。

HelloWorldScene.cpp
 
#include "HelloWorldScene.h"
USING_NS_CC;
Scene* HelloWorld::createScene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = HelloWorld::create();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !Layer::init() )
{
return false;
}
//------------------------------------
///
//
//テクスチャアトラスを読み込む
auto cache = SpriteFrameCache::getInstance();
cache->addSpriteFramesWithFile("img_ship_00.plist", "img_ship_00.png");
//その画像でCCSpriteBachNodeを作成
/// アニメーションフレームに画像を追加
/// [例]
/// img_ship_00.png
/// img_ship_01.png
/// img_ship_02.png
/// img_ship_03.png
/// という画像があるとします
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////http://nyakagawan.hatenablog.com/entry/2014/03/22/112513
//////////////////////////////////////////////////////////////////////////////////////////////
auto _sprite1 = Sprite::createWithSpriteFrameName("img_ship_01.png");
_sprite1->setPosition( Point( 300, 300) );
Vector<SpriteFrame*> animFrames(5);
for( int i=1; i<5; i++ )
{
char filename[128] = {0};
//sprintf(filename,"hoge_%02d.png",i);
//の、%02dという部分ですが、これは、例えば i が 1 の時、“hoge_01.png”となります。
//もう一つ例を上げておくと
//sprintf(filename,"hoge_%01d.png",i);
//の時、同じように i が 1 の場合、“hoge_1.png”となります。
sprintf(filename,"ループ回数:%2d",i);
puts(filename);
sprintf(filename,"img_ship_%02d.png",i);
puts(filename);
//Sprite* spr = Sprite::createWithSpriteFrameName(filename);
auto frame = cache->getSpriteFrameByName( filename );
animFrames.pushBack(frame);
}
auto animation = Animation::createWithSpriteFrames(animFrames, 0.01f);
_sprite1->runAction( RepeatForever::create( Animate::create(animation) ) );
this->addChild(_sprite1);
/*
/// アニメーションを切り替える速度を決める
/// ※1.0fで一秒になります
pAnimation->setDelayPerUnit( 0.1f );
/// 無限ループさせる
/// [例]
/// 1  ... 一回ループさせる
/// 2  ... 二回ループさせる
/// -1 ... 無限ループさせる
pAnimation->setLoops(-1);
/// アニメーションの生成
//CCAnimate* pAnimate = CCAnimate::create(pAnimation);
Animate* pAnimate = Animate::create(pAnimation);
/// スプライトの生成
//CCSprite* pSprite = CCSprite::create();
Sprite* pSprite = Sprite::create();
/// レイヤーにスプライトを追加
this->addChild(pSprite);
/// スプライト座標を設定する
//pSprite->setPosition(CCPointMake(0.0f,0.0f));
pSprite->setPosition(300,300);
/// アニメーションを実行する
pSprite->runAction(pAnimate);
*/
////////////////////////////////////////////////////////////////////
return true;
}
void HelloWorld::menuCloseCallback(Ref* pSender)
{
Director::getInstance()->end();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif
}


HelloWorldScene.h はそのままだよ
#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
class HelloWorld : public cocos2d::Layer
{
public:
// there's no 'id' in cpp, so we recommend returning the class instance pointer
static cocos2d::Scene* createScene();
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool init();  
// a selector callback
void menuCloseCallback(cocos2d::Ref* pSender);
// implement the "static create()" method manually
CREATE_FUNC(HelloWorld);
};
#endif // __HELLOWORLD_SCENE_H__
| whaison | cocos2d-x | 20:34 | comments(1) | - | pookmark |