Skip to content

Instantly share code, notes, and snippets.

View anzfactory's full-sized avatar
:octocat:
Working from home

anz anzfactory

:octocat:
Working from home
View GitHub Profile
@anzfactory
anzfactory / MyMacro.h
Last active August 29, 2015 13:56
個人用マクロ集
//
// MyMacro.h
//
// Created by ANZ on 2014/07/07.
//
//
#ifndef cocos3rc1_MyMacro_h
#define cocos3rc1_MyMacro_h
@anzfactory
anzfactory / LabelAttributedBMFont.cpp
Last active August 29, 2015 13:57
RPG風文字送り&ページ送りをするラベル
#include "LabelAttributedBMFont.h"
USING_NS_CC;
using namespace std;
#define NEWLINE_CHAR "\n"
#define NULL_CHAR ""
#include "Stopwatch.h"
USING_NS_CC;
using namespace std;
#define StopwatchUDKeyStart "start-time"
#define StopwatchUDKeyElapsed "elapsed-time"
static Stopwatch *s_instande;
@anzfactory
anzfactory / CCArraySort.cpp
Last active August 29, 2015 13:57
CCDictionaryを保持しているCCArrayやCCDictionaryのソート
void CCArraySort::test()
{
// ソート対象がCCArrayの場合
auto table = makeDummyList();
std::sort(table->data->arr, table->data->arr + table->data->num, compare);
// 確認ログ
CCObject* item;
CCARRAY_FOREACH(table, item) {
@anzfactory
anzfactory / CommonDialogFragment.java
Created April 24, 2014 18:04
DialogFragmentを自分なりに汎用的に使えるようにしてみた ref: http://qiita.com/AnzNetJp/items/380a264f8ef48372b85d
public class CommonDialogFragment extends DialogFragment {
public interface CommonDialogInterface {
public interface onClickListener {
void onDialogButtonClick(String tag, Dialog dialog, int which);
}
public interface onShowListener {
void onDialogShow(String tag, Dialog dialog);
}
@anzfactory
anzfactory / Readme.md
Last active August 29, 2015 14:00
Readme修正

TumblrRelationPost

tumblrで表示中の記事と同じタグをもつ記事を取得してくるjs

使い方

準備

TumblrRelationPost.jsを取得。
あるいはソースをコピペしてローカル保存

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

void play()
{
// 一旦0に(SpriteをFadeInするときとかに、最初は非表示にしておくようなもん)
SimpleAudioEngine::getInstanse->setBackgroundMusicVolume(0.f);
stopAllActions(); // 多重実行しないように
runAction(Sequence::create(
PlayBGM::create("bgm.mp3"), // bgm再生
FadeToVolumeOfBGM::create(3.f, .5f), // 3秒かけて音量0.5に
DelayTime::create(5.f),
@anzfactory
anzfactory / share_facebook_sample.java
Created May 28, 2014 16:02
Facebookの公式アプリを投稿画面にリンク設定した状態で呼び出す方法
private void shareFacebook(String text)
{
String packageName = "com.facebook.katana";
String activityName = null;
// 該当パッケージをもつアプリで、ACTION_SENDに対応しているactivityを取得する
// 暗黙的インテントで表示されるリストから該当のアプリを探し出すという感じ
PackageManager pm = getPackageManager();
Intent intent = new Intent( Intent.ACTION_SEND );
intent.setType("text/plain");
@anzfactory
anzfactory / script.cs
Last active August 29, 2015 14:03
Gui.ModalWindow使ってみた
private const int ModalWindowId = 100;
private Rect windowRect;
void OnGUI()
{
windowRect = GUI.ModalWindow(
ModalWindowId,
new Rect(0, 0, Screen.width, Screen.height),
ModalWindowCallback,
"モーダルだよー!"