This file contains hidden or 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
| import CoreLocation | |
| class Geospatial: NSObject { | |
| //JSON 全体の構成 | |
| struct Json: Codable { | |
| let elevation: Double | |
| let hsrc: String | |
| } |
This file contains hidden or 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 func centerCoordinate(mapView: GMSMapView) -> CLLocationCoordinate2D { | |
| let frame = mapView.frame | |
| let pos = CGPoint(x:mapView.center.x - frame.origin.x, | |
| y:mapView.center.y - frame.origin.y); | |
| //中央の座標 | |
| let coordinate = mapView.projection.coordinate(for: pos) | |
| return coordinate; |
This file contains hidden or 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
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using System.Xml; | |
| /** | |
| * MEMO: 2017.04.19 | |
| * とりあえず 指定の書式のxml を読み込む | |
| * エラー処理は基本考慮していない |
This file contains hidden or 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
| //world ... b2World | |
| { | |
| //DestroyBody -> DestroyJoint | |
| for (auto body = world->GetBodyList(); body; body = body->GetNext()) | |
| { | |
| world->DestroyBody(body); | |
| } | |
| // for (auto joint = world->GetJointList(); joint; joint = joint->GetNext()) | |
| // { |
This file contains hidden or 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 <random> | |
| //処理例 | |
| { | |
| //乱数の初期化 | |
| std::mt19937 rng; | |
| { | |
| // 非決定的な乱数生成器 | |
| std::random_device rnd; |
This file contains hidden or 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 "HelloWorldScene.h" | |
| #include "GLES-Render.h" | |
| USING_NS_CC; | |
| #pragma mark | |
| const float HelloWorld::PTM_RATIO = (32.0f); |
This file contains hidden or 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
| const auto fileName = "image.png"; | |
| if (auto frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(fileName)) | |
| { | |
| if (auto sprite = Sprite::createWithSpriteFrame(frame)) | |
| { | |
| this->addChild(sprite); | |
| } | |
| } | |
| else if (FileUtils::getInstance()->isFileExist(fileName)) | |
| { |
This file contains hidden or 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
| // 文字列変換 | |
| // 拡張子を変換 ... を想定 | |
| std::string replaceExtension(std::string fileName, | |
| const std::string fromExt, | |
| const std::string toExt) | |
| { | |
| //Ex. | |
| //std::string fileName = "samplefile.plist"; //-> "samplefile.pvr.ccz"; | |
| //const std::string fromExt = ".plist"; | |
| //const std::string toExt = ".pvr.ccz"; |
This file contains hidden or 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
| //解像度設定 | |
| { | |
| //横画面 | |
| //const auto designResolutionSize = Size( 480, 320); | |
| //const auto smallResolutionSize = Size( 480, 320); | |
| //const auto mediumResolutionSize = Size(1024, 768); | |
| //const auto largeResolutionSize = Size(2048, 1536); | |
| //縦画面 | |
| const auto designResolutionSize = Size( 320, 480); |