Skip to content

Instantly share code, notes, and snippets.

@sthairno
sthairno / ScrollBar.cpp
Last active June 8, 2023 18:43
アニメーション付きのヌルヌル動くスクロールバー
# include <Siv3D.hpp>
namespace SasaGUI
{
namespace Config
{
struct ScrollBar
{
// | ______________ |
// | =======|______________|== |
@sthairno
sthairno / Dockerfile
Created March 27, 2024 06:53
Container which builds and installs OpenSiv3D
FROM ubuntu:22.04
ARG SIV3D_VERSION="main"
ARG GCC_OPTIONS="-j4"
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
build-essential \
cmake \
@sthairno
sthairno / Main.cpp
Last active October 20, 2024 09:21
OpenSiv3Dで某アクションゲームのメニュー画面を再現したデモ
#include <Siv3D.hpp>
#include <FlexLayout.hpp>
struct Item
{
String emoji;
int level;
};
@sthairno
sthairno / DrawStripe.cpp
Created December 24, 2024 03:39
OpenSiv3Dで縞模様を描く
#include <Siv3D.hpp>
void DrawStripe(const Rect& rect, double angle, double barWidth, const Array<ColorF>& pattern = { Palette::Yellow, Palette::Black })
{
// 傾けたときの描画範囲を計算
const auto renderRect =
RectF{ 0, 0, rect.size }.asQuad()
.rotatedAt(0, 0, -angle)
.boundingRect();
@sthairno
sthairno / Redis_Siv3D.cpp
Created December 27, 2024 22:21
OpenSiv3Dにredis-plus-plusを組み込んでみた実験
#include <Siv3D.hpp> // Siv3D v0.6.15
#include <sw/redis++/redis++.h>
void Main()
{
Window::Resize(400, 300);
// Redisサーバーに接続
sw::redis::ConnectionOptions options;
options.type = sw::redis::ConnectionType::TCP;