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 <Siv3D.hpp> | |
# include <HamFramework.hpp> | |
struct GameData {}; | |
struct Game : SceneManager<String, GameData>::Scene | |
{ | |
Font font; | |
Circle player; | |
Array<Circle> bullets; |
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 <Siv3D.hpp> | |
class Anime | |
{ | |
public: | |
Anime(const Texture& texture, int size, int frame) : | |
m_texture(texture), | |
m_size(size), | |
m_frame(frame), | |
m_index(0), |
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 <Siv3D.hpp> | |
Image createImage(const Array<Image>& images) | |
{ | |
int width = 0; | |
int height = 0; | |
for (const auto& image : images) | |
{ | |
width += image.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
FilePath savedataPath = L"Savedata.csv"; | |
CSVReader reader(savedataPath); | |
if (!reader) | |
{ | |
CSVWriter writer(savedataPath); | |
writer.writeRow(Vec2::Zero, 100, 100); | |
writer.writeRow(L"はじまりの町"); | |
writer.writeRow(Palette::Green); | |
writer.close(); |
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
// 失敗した場合Vec2() | |
Vec2 r1 = reader.get<Vec2>(0, 0); | |
// 失敗した場合、引数で指定した値 | |
Vec2 r2 = reader.getOr<Vec2>(0, 0, {0.0, 0.0}); | |
// Optionalの値が返って来る。失敗ならnone | |
Optional<Vec2> r3 = reader.getOpt<Vec2>(0, 0); |
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 <shlobj.h> | |
wchar_t appdataPath[MAX_PATH]; | |
FilePath savedataPath; | |
if (SHGetSpecialFolderPath(NULL, appdataPath, CSIDL_APPDATA, true)) | |
{ | |
savedataPath = Format(appdataPath, L"/Asablo/Savedata.csv"); | |
} | |
else |
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 <Siv3D.hpp> | |
# include <shlobj.h> | |
void Main() | |
{ | |
wchar_t appdataPath[MAX_PATH]; | |
FilePath savedataPath; | |
if (SHGetSpecialFolderPath(NULL, appdataPath, CSIDL_APPDATA, true)) | |
{ |
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
std::unordered_map<String, String> m_data; | |
template<typename Type> void add(const String& key, const Type& value) | |
{ | |
m_data[key] = Format(value); | |
} | |
template<typename Type> Optional<Type> getOpt(String key) const | |
{ | |
if (hasKey(key)) |
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
bool save(const FilePath& filePath) | |
{ | |
String data = L""; | |
for (auto content : m_data) | |
{ | |
data += m_delimiter + content.first + m_delimiter + content.second; | |
} | |
const MemoryReader encrypted = Crypto::EncryptString(data, m_aes128Key); |
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
using UnityEngine; | |
using System.Collections; | |
public class OverstateUI : MonoBehaviour | |
{ | |
[SerializeField] Vector3 m_MaxSize = Vector3.one; | |
[SerializeField] Vector3 m_MinSize = Vector3.zero; | |
[SerializeField] float m_AngularFrequency = 1.0f; | |
float m_Time; |
OlderNewer